Assume that the following code exists inside a method of the class MyClass, and that this code compiles without errors: int result = book.getYearPublished(); where book is an object of the Book class. Which of the following is not true about the getYearPublished method? It is a mutator method. It is a public method in the Book class. It returns a String.

Respuesta :

Answer:

"it returns a string"  is not true about the method.

Explanation:

Since int result = book.getYearPublished() compiles without errors inside a method of the MyClass, "int result " part of the code states that the method returns an integer, not a string. getYearPublished is a mutator method and a public method in the Book class.

Answer: The getYearPublished method is not a mutator method nor does it return a string.