Answer:
I and II only
Step-by-step explanation:
It is an accessor method ; the getYearPublished() is meant to read data from book objects defined in the book class, the getYearPublished() will likely read the year in which the book was published, hence it is an accessor method as accessors read from data members.
Since, getYearPublished() can read from object of the book class, then it would be a public method because class objects has no authorization to private data and hence will throw an error.
String are letters or words, however, the returned result indicates an integer, hence, an integer rather than a string is returned.