subject
Computers and Technology, 12.01.2021 18:00 rome58

In this exercise, you are going to be working with 4 classes, a Book superclass with TextBook and Novel subclasses, and a BookTester class to run your program. For the Book, TextBook, and Novel class, you will create a constructor and all getters and setters. Be sure to follow standard naming conventions for your getters and setters! Additional information for each class is below. Book Class
The Book class will have a title and author as instance variables and the constructor should follow this format:
public Book(String title, String author)
TextBook Class
The TextBook class will have a subject and edition as instance variables and the constructor should follow this format:
public TextBook(String title, String author,
String subject, String edition)
Novel Class
The Novel class will have a genre and pages as instance variables and the constructor should follow this format:
public Novel(String title, String author,
String genre, int pages)
BookTester
In the tester class, you should create an ArrayList that will store all the books in your library. Then create you library by adding at least 3 textbooks and 3 novels to the ArrayList.
After creating your library, use a loop to access the ArrayList and print out any information you have access to.
public class Novel extends Book
{
// Start here!
}
public class Book
{
// Start here!
}
public class TextBook extends Book
{
// Start here!
}
import java. util. ArrayList;
public class BookTester
{
public static void main(String[] args)
{
// Start here!
}
}

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:20, vuqepete4528
Shown below is the start of a coding region within the fist exon of a gene. 5'--3' 3'--5' how many cas9 pam sequences are present?
Answers: 1
image
Computers and Technology, 22.06.2019 11:00, tristina20
The isometric projection camera technique provides an illusion of perspective by using things like parallax scrolling to create the illusion of 3d in a 2d game
Answers: 3
image
Computers and Technology, 22.06.2019 20:00, jumpgirll
The blank button automatically displays next to the data when you select a range of numeric data which is an available option for creating a chart
Answers: 3
image
Computers and Technology, 22.06.2019 22:30, kierafisher05
What is the most popular genre of video games?
Answers: 1
You know the right answer?
In this exercise, you are going to be working with 4 classes, a Book superclass with TextBook and No...

Questions in other subjects:

Konu
Mathematics, 26.08.2019 13:30