Question: For this question you will write a class that implements an interface. The interface describes methods needed by classes that are part of program used

For this question you will write a class that implements an interface. The interface describes methods needed by classes that are part of program used by a city's library website. Here is the interface:
public interface LendingMedia {
public String getTitle();
public String getAuthorFirstName();
public String getAuthorLastName();
public int getYearPublished();
public String getPublihser();
public boolean isAvailable();
}
For this question you are to write below a class called Book that implements the interface called LendingMedia.
Be sure to include in the Book class declarations of all variables needed to store the data that is retrieved by the methods you implement.
Include in the Book class a constructor that takes parameters: title, authorFirstName, authorLastName, publisher, yearPublished. And stores this information into the class variables. All book objects constructed should be have their available value be true.
Override in the Book class the toString method so that it will return a citation for the book in the format:
Author last name, Author first name. Title, Publisher, Year.
For example:
Gorman, Amanda. Call Us What We Carry, Viking, 2021.

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!