I'm supposed to compare objects within a list to a given value and then pass them to another list if the values tally. But the code does not compile; javac says cannot find symbol
public class Librarian {
private ArrayList<Book> bookList;
public Librarian () {
bookList = new ArrayList<Book>();
}
public ArrayList<Book> findBooksWrittenBy(ArrayList<Book> inputList, String author) {
ArrayList<Book> authorList = new ArrayList<Book>();
for (int position = 0 ; position < inputList.size() ; position++ ) {
Book temp = inputList.get(position);
String bkAuthor = temp.getAuthor();
if (bkAuthor.equalsIgnoreCase(author)) {
authorList.add(temp);
}
}
return authorList;
}
}