Question: Java Refer to the following Book class. public class Book private String myAuthor, private String myTitle, // default constructor public Book() { /* implementation Il

Refer to the following Book class. public class Book private String myAuthor, private String myTitle, // default constructor public Book() { /* implementation Il constructor public Book(String author, String title) (implementation"} // Retums author of Book public String getAuthor() { /* implementation Returns title of Book public String getTitle() { /* implementation) Returns String representation for Book as author followed by title Il for example "Jane Austin Persuasion" public String toString({/body puoic ManYBOOKSU {r implementation nor snown // Lists the titles only of all the books in bookList, one per line public void displayTitles() { /* implementation code *} 3 Which of the following is a correct /* implementation code for displayTitles? for (Book b: bookList) System.out.println(b.getTitle()); II. int index = 0; while (index
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
