Question
Using Java create the following classes below. You need to create four classes for a good rate, the classes are: Date, Book, BookStore, and Main(or
Using Java create the following classes below.
You need to create four classes for a good rate, the classes are: Date, Book, BookStore, and Main(or tester)
Date Create a class called Date, with private instance variables, accessors, mutators, and constructor parameters for the following data: year, month, day (all ints). It also has a method called getDate() which returns a String in the format of yyyy-mm-dd.
Book Create another class called Book, with private instance variables, accessors, mutators, and constructor parameters for the following data: title (a String) and datePublished (a Date). It also has a second constructor, which takes the title (String), year, month, and day (ints) as parameters.
BookStore Create a class called BookStore with an ArrayList of five ArrayList Book references; use both Book constructors when populating the ArrayList. Also create an Array of the same five Book references.
Create a method called displayBooks which displays the title and getDate() data for all the books in the ArrayList (use an iterator) and in the Array (use a for-each loop).
And Obviously a Main class(tester).
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