Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assume that the following classes have been created. Do not write any import sta

ID: 3876259 • Letter: A

Question

Assume that the following classes have been created. Do not write any import statements. A class named Bird and a sub-class named FlightlessBird. The Bird class has a String attribute called name, and another String attribute called countryOfOrigin. These are all set by the constructor in that order. The FlightlessBird class inherits all the attributes from the Bird class. It also has a boolean attribute called endangered. These are all set by the constructor by making use of a call to the super class constructor of the Bird class. The constructor of the FlightlessBird class is responsible for setting its own class variable endangered. This has all been done for you. You do not need to create the classes listed above. What you need to do: 1.) Declare and instantiate and array named birds that is capable of holding both types of objects: Bird and FlightlessBird 2.) The array should be able to hold a maximum of 2 objects. 3.) Declare and instantiate an Bird object named griffon with the following parameters Name = "Griffon" Country of Origin = "Israel" 4.) Declare and instantiate a FlightlessBird object named ostrich with the following parameters Manufacterer = "Ostrich" Model Number = "Israel" middotEndangered = true 5.) Assign the griffon to the first position in the array. 6.) Assign the ostrich to the second position in the array.

Explanation / Answer

1.

3. Bird griffon = new Bird(""Griffon", "Israel");

4.

5.

birds[1] =griffon;

6. birds[2] = ostrich ;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote