Answered step by step
Verified Expert Solution
Question
1 Approved Answer
JAVA , THANKS ! Assume that the following classes have been created. Do not write any import statements. A class named Bird and a sub-class
JAVA , THANKS !
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 obiects. 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" Endangered = true 5.) Assign the griffon to the first position in the array. 6.) Assign the ostrich to the second position in the arrayStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started