Question: In JAVA . CODE with comments and output screenshot is must...Do not copy from other websites Correct and detailed answer Mammal -eggLaying: boolean -habitat: String
In JAVA .
CODE with comments and output screenshot is must...Do not copy from other websites
Correct and detailed answer


Mammal -eggLaying: boolean -habitat: String +Mammal() +Mammal(eggLaying:boolean, habitat:String, numOfLegs:int, diet: String) +getEggLaying(): boolean +getHabitat: String +setEggLaying(boolean eggLaying) +setHabitat(String habitat) +toString(): String Horse -color: String +Horse(color: String) +getColor(): String +setColor(String color) +equals(Horse horse): boolean2. Create an Animal array with a size 5. a. Store the 5 different Animal objects from the Main class into the array. b. Create a method that prints out the contents of an Animal array. o. Using seleotion sort, sort the Animals in ascending order based on the number of legs. Use the method on your Animal array. d. Display the array of Animals. e. Using the improved linear search algorithm, oreate a method that will find an Animal object based on the number of legs. Your method should take in an Animal array and numOfLegs {key} as the parameters. If the Animal is found, return true, else, return false
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
