Question: Creating classes in Java: Create Bookcase class (understood as a bookcase inside a bookstore). Each bookcase must be dedicated to a certain literary genre included

Creating classes in Java:

Create Bookcase class (understood as a bookcase inside a bookstore). Each bookcase must be dedicated to a certain literary genre included in the list of genres (novel, thriller, essay, manual) and therefore must contain only books of the same genre. In the Bookcase class there must be a method called addBook(Book book), which allows you to add a book with the correct genre to the bookcase. Also create the Bookstore class. A bookstore must contain only one bookcase for each genre, and therefore it is necessary to prevent that two bookcases with the same genre can be added. In addition, the Bookstore class must implement the Singleton pattern. Finally create a BookstoreTest class, which creates an object of type Bookstore adding to it objects of type Bookcase to which have been added objects of type Book. Verify that two bookcases with the same genre cannot be added to the bookstore.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Creating classes in Java with the specifications provided involves implementing different class types following specific software design patterns and ensuring logical constraints are upheld in your de... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!