OOP-Question - 2
OOP-Question - 2
*;
import java.util.ArrayList;
import java.util.Scanner;
@Override
public String toString() {
return name;
}
}
@Override
public String toString() {
return "Book{name='" + name + "', publisher='" + publisher + "', author=" +
author + "}";
}
}
// Display books
private static void displayBooks(ArrayList<Book> books) {
System.out.println("Books available in the store:");
for (Book book : books) {
System.out.println(book);
}
}
if (!found) {
System.out.println("Book not found in the records.");
}
}
}