Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

3. How has e-commerce transformed marketing?

Answered: 1 week ago