Question
Design and implement a Java data structure class named BookShelf which has an array to store books and the size data member. The class should
Design and implement a Java data structure class named BookShelf which has an array to store books and the size data member. The class should have suitable constructors, get/set methods, and the toString method, as well as methods for people to add a book, remove a book, and search for a book.
Design and implement a Java class named Book with two data members: title and price.
Test the two classes by creating a bookshelf object and five book objects. Add the books to the bookshelf.
Display the contents of the bookshelf.
Now re-implement the Bookshelf class using a linkedlist and a Node class. Implement the above add, remove, and search methods again.
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