Answered step by step
Verified Expert Solution
Question
1 Approved Answer
JAVA QUESTION Suppose you have written a class, Book, in which it has the following instance variables: String name String author int pages double price
JAVA QUESTION
Suppose you have written a class, Book, in which it has the following instance variables:
String name
String author
int pages
double price
Override two methods toString() and equals(), based on the following information:
If you printout an instance of Book, the printout should be like this:
-------------------
Book name: ....
By: ....
Number of pages: ...
Unit Price: ....
---------------------
And two books are equal if their names, authors, and prices are equal
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