Computers and Technology

Public class Magazine { private static double SUBSCRIPTION_DISCOUNT = .60;
private String title;
private String publisher;
private double newsstandPrice;
public Magazine(String theTitle, String thePublisher, double theNewsPrice) {
title = theTitle;
publisher = thePublisher;
newsstandPrice = theNewsPrice;
public String getTitle() {
return title;
}
public String getPublisher() {
return publisher; }
public double getNewsstandPrice() {
return newsstandPrice;
}
public double getSubscriptionPrice() {
// implementation not shown
}
public void setNewsstandPrice(double newPrice) {
newsstandPrice = newPrice;
}
}
Which of the following will correctly instantiate a Magazine object in a client class?
I. Magazine mag = new Magazine("Popular Mechanics");
II. Magazine mag = "Reader's Digest", "Fantastic Publishers", 2.5);
III. Magazine mag = new Magazine("National Review", "Esteemed Publishing", 3.25);

Statement I
Statement II
Statement III
Statement I and II
Statement I and III only

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 03:40, hussain34
Mary's manager told her she should insert a graphic into her documentwrite mary a brief note describing how to insert a graphicin a word processing document.
Answers: 1
image
Computers and Technology, 22.06.2019 06:50, wtfcmd
Match the personality traits with their description
Answers: 1
image
Computers and Technology, 23.06.2019 06:00, sebcbal
When is a chart legend used a. all the time b. whenever you are comparing data that is the same c. whenever you are comparing multiple sets of data d. only for hand-drawn charts
Answers: 2
image
Computers and Technology, 23.06.2019 10:30, badpotterchris
How would you categorize the software that runs on mobile devices? break down these apps into at least three basic categories and give an example of each.
Answers: 1
Do you know the correct answer?
Public class Magazine { private static double SUBSCRIPTION_DISCOUNT = .60;
private String ti...

Questions in other subjects:

Konu
Chemistry, 23.04.2020 03:38