Question: Library.java This class will represent a university Library that will contain the following private instance variables Book [] books: this will represent the books that

Library.java This class will represent a university Library that will contain the following private instance variables Book [] books: this will represent the books that are within the library. int capacity: this represents the maximum capacity of books a library can have. int size: this represents the number of non-null elements within the books array. This class will also have the following public instance methods void addBook (Book book) o This will add a book to the end of the books array at index size. o If the books array is full, then print out Cannot add book, library is full!" o Be sure to update size as necessary. getters for all instance variables. This class will have the following constructors Library() - this constructor will set capacity to 10 and instantiate the books array to be of length capacity. o You must use constructor chaining to chain this constructor to Library(int capacity). Library (Book[] books) - this constructor will set capacity and size to be the parameter books's length. It will also set the instance variable books equal to the passed in parameter. You may assume that the parameter won't be null, and no books in the array will be null. Library(int capacity) - this constructor will set capacity equal to the passed in capacity as well as instantiate books to be of length capacity
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
