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

1 Expert Approved Answer
Step: 1 Unlock 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!