Question
Create a Book class with the given fields and methods (attached). Also, make sure to define the constructors. Details: Write a demo class to create
Create a Book class with the given fields and methods (attached). Also, make sure to define the constructors.
Details:
Write a demo class to create two Book objects. First, create a Book1 object that represents your book (Java for Dummies), and second, create another Book2 object that holds information about the users favorite book. For Book2 object, get input for the book information from the user. Finally, display the book information (e.g., title, author, publisher) for both objects.
Define toString() method if needed.
Include comments in your code explaining what tasks are performed by different classes, methods, and statements of your code.
Book title: String author: String publisher: String - + Book + Bookt:String, a:String, p:String) + setTitle(t:String): void + setAuthor(a:String): void + setPublisher(p:String): void + getTitle(): String + getAuthor(): String + getPublisher(): StringStep 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