Question: Choose an animal. Create a class that will represent this animal. Rename file1.java to whatever your class name is. It should have two instance variables,

Choose an animal. Create a class that will represent this animal. Rename file1.java to whatever your class name is.
It should have two instance variables, color, and sound, both Strings.
Write a setter and getter for each instance variable.
Write a standard, default, and copy constructor.
Write a method speak which displays (prints) the sound to the console.
Write a toString method.
Complete Main.java by replacing each comment with its appropriate code.
 Choose an animal. Create a class that will represent this animal.

Han javd Monkay jova Instructions from your teacher 1- klass Main 2public static void nain(Stringti args) Choose an animal. Create a class that will represent this animal. Rename file1 java to whatever your class name is It should have two instance variables, color, and sound, both Strings //create an object using the default constructor //create an object using the standand constructor //create an object using the copy constructor //print the default object //print the standard object //print the copy object //call the speak nethod on the standard object Write a standard, default, and copy constnactor Write a method speak which displays (prints) the sound to the console Write a toString method Complete Main java by replacing each comment with its appropriate code 10 Each student should have a unique animal. You may not copy another student's work

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!