Question: 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
Get step-by-step solutions from verified subject matter experts
