subject

The following class contains code to define a nintendo character where characters have a name and a primary outfit color. the main method creates 3 instances of this, each different characters in the game update the main method to add these three characters to a collection (of any type), then iterate through the collection and print each character. next, sort the collection and print each character again

public class nintendocharacter implements comparable {

private color color;
private string name;

public nintendocharacter { color outfitcolor, string charactername } {
this. color = outfitcolor;
this. name = charactername;

@override
public int compareto (object o) {
return color. ( ((nintendocharacter)o).color, to. string() );
}

public string tostring () {
return name + " : " + color. tostring ();
}

public static void main (string[] args) {
nintendocharacter m = new nintendocharacter (color. red, ? mario");
nintendocharacter l = new nintendocharacter (color. gree, "luigi");
nintendocharacter p = new nintendocharacter (color. magenta, "princess peach");

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:30
What result from the passage of this amendment
Answers: 1
question
Computers and Technology, 23.06.2019 09:00
Which best compares appointments and events in outlook 2010appointments have a subject man, and events do notappointments have a specific date or range of dates, and events do notappointments have a start and end time of day, and events do notappointments have a location option, and events do not
Answers: 2
question
Computers and Technology, 23.06.2019 13:30
Select the correct answer from each drop-down menu. which types of computer networks are bigger as well as smaller than a man? a man is a network of computers that covers an area bigger than a , but smaller than a .
Answers: 1
question
Computers and Technology, 24.06.2019 08:10
Where are american poets found in the dewey decimal system
Answers: 1
You know the right answer?
The following class contains code to define a nintendo character where characters have a name and a...
Questions
question
Mathematics, 10.02.2021 14:00
question
Mathematics, 10.02.2021 14:00
question
French, 10.02.2021 14:00
question
Mathematics, 10.02.2021 14:00
Questions on the website: 13722362