subject

The Toy class is started below. Write three constructors for this class as explained in the comments below. public class Toy
{
private String toyName;
private String toyMaker;
private double toyCost;
//default constructor
//constructor which has two String parameters
// constructor with three parameters
}
2. The Song class is provided below, but the constructors contain errors. Read the comments to determine the number of errors, then find the errors. Each line of code can have zero, one, or more than one errors. If a line of code contains errors, rewrite it correctly to the right.
public class Song
{
private String title;
private String artist;
private int trackMinutes;
private int trackSeconds;
// default constructor contains 2 errors
public void Song
{
title = artist = "";
trackMinutes = trackSeconds = 0.0;
}
// 1-arg constructor contains 5 errors
public song( title)
{
title = title;
artist = 0;
trackMinutes = "";
trackSecond = 0;
}
// 2-arg constructor contains 3 errors
public Song(String t, a)
{
t = title;
a = artist;
trackMinutes = trackSeconds = 0;
}
//4-arg constructor contains 4 errors
private Song(String t, String a, int min, int sec);
{
title = t;
artist = art;
trackMin = min;
trackSec = sec;
}
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:30
Kto rozmawia z clamentain przez krótkofalówke w the walking dead w 4 epizodzie
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
Which location-sharing service offers items for users as a gaming component and also allows them to collectively link their check-ins to publish a trip? a. whrrl b. buzzd c. foursquare (this option is wrong i already tried) d. gowalla for plato
Answers: 2
question
Computers and Technology, 22.06.2019 22:40
Write a program that defines symbolic names for several string literals (chars between quotes). * use each symbolic name in a variable definition. * use of symbolic to compose the assembly code instruction set can perform vara = (vara - varb) + (varc - vard); ensure that variable is in unsigned integer data type. * you should also further enhance your symbolic logic block to to perform expression by introducing addition substitution rule. vara = (vara+varb) - (varc+vard). required: debug the disassembly code and note down the address and memory information.
Answers: 3
question
Computers and Technology, 23.06.2019 02:30
How to launch an app: steps to be successful? launching an app is a great idea, but it’s not that easy as we supposed to think. the majority of mobile applications don’t generate revenue because companies aren’t ready to be competitive. referring to our experience in successfully building and launching apps we hope to you omit these difficulties. we are going to talk about ideas, marketing, testing your product, its development, distribution and support. you will learn 8 product launch stages to succeed.
Answers: 1
You know the right answer?
The Toy class is started below. Write three constructors for this class as explained in the comments...
Questions
question
Mathematics, 13.01.2020 20:31
Questions on the website: 13722363