Question
Provide an implementation of the class Library as well as of BookComparator . Use the provided template as a starting point for the class Library
Provide an implementation of the class Library as well as of BookComparator. Use the provided template as a starting point for the class Library and the provided template for BookComparator.
import java.util.ArrayList;
public class Library {
private ArrayList
public Book getBook(int i) {
return library.get(i);
}
public int getSize() {
return library.size();
} public void addBook (Book b) {
// Your code here
} public void sort() {
// Your code here
} public void printLibrary() {
// Your code here
}
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started