Question: Java. Please help with the following assignment. Thanks. First: Create an interface definition called Reference. -A Reference refers to a quoted reference from book or

Java. Please help with the following assignment. Thanks.

First:

Create an interface definition called Reference.

-A Reference refers to a quoted reference from book or research paper etc, such as (Savitch, 2016)

-The Reference Interface has two methods:

-getAuthor method that returns a String representing the reference's author

-getYear method that returns an integer representing the copyright year.

Second:

Create a Book class that implements the Reference Interface.

-Instance Variables

-author - String representing the book's author

-year - Integer representing the copyright year published

-title - String representing the book's title

-Constructor that takes in 3 parameters that initialize each of the three instance variables.

-Methods required by the Interface.

Third:

Create a BookStore ClassContains a main method

Creates an ArrayList of type Reference

Add three Book objects to the ArrayList.

Using the appropriate loop type, iterate through the ArrayList

Loop must work for all implementations of Reference, not just for Books, of course.

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!