What is wrong with the following code? Why? How can you fix it? // Remove all the books which contain the given keyword in book title public void removeAllBooks(String keyword) { for(Book b:...


What is wrong with the following code? Why? How can you fix it?



// Remove all the books which contain the given keyword in book title public void removeAllBooks(String keyword) {



for(Book b: booksList) {


if (b.getTitle().indexOf(keyword)>=0) { booksList.remove(b);


}


}


}



Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here