[Solved] Class called Book

30 $

SKU: [Solved] Class called Book Category: Tag:

Write a complete class called Book that has private instance variables for the title and author of the book and the following methods:

  • A default constructor that sets the title to “Untitled” and the author to “Anonymous”
  • A two-argument constructor that initializes the author and title to the provided arguments.
  • A public void method called display that displays the title, the word “by,” and the author. For example if the title is “The Handmaid’s Tale” and the author is “Margaret Atwood”, the method would display:
The Handmaid's Tale by Margaret Atwood

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] Class called Book
30 $