Question: Java: An interface Terrestrial. It contains - String walk An interface class Aquatic. It contains: - String swim) An abstract class Animal. It contains public
Java:


An interface Terrestrial. It contains - String walk An interface class Aquatic. It contains: - String swim) An abstract class Animal. It contains public String sound I/set the default sounds to "No Sound" A concrete class Cougar extends Animal implements Terrestrial -Override walk) -Override sound ) Override toString O://call the walk) and sound ) methods A concrete class Fish extends Animal implements Aquatic Uses default sound. Override swim) Override toString //call the swim) methods A concrete class Turtle extends Animal implements Terrestrial, Aquatic -Override walk) Override swim) -Override sound ) Override toString //call the walk),swim), and sound) methods Driver program ArrayList of Animals: Cougar, Fish, and Turtle - Print all of the objects using the toString) method
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
