Question: class Fish extends Animal Sub Let's say we have these three classes: class Animal Super class Cat extends Animal Subs int numflegs; void hunt(Animal animal)
class Fish extends Animal Sub Let's say we have these three classes: class Animal Super class Cat extends Animal Subs int numflegs; void hunt(Animal animal) double weight; double length; eat(animal.weight); void eat(double amount) weight = weight + amount; length = length + .01; void eat(double amount) weight = weight + amount; void poop(double amount) weight = weight - amount; Is there any different in what you can do with a 'Cat' object if you create it as an animal vs a cat? ex. Cat mr Meow = new Cat(); Animal mr Meow = new Cat(); (Hint: What properties and methods what be available in each case?) provient class, the Same question for the fish, is there any difference in what is available if you do the following? ex. Fish mrBubbles = new Fish(); or Animal mrBubbles = new Fish()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
