Question: When using inheritance, what does it mean when you make a parent class abstract -> What does it mean when you make a specific method
When using inheritance, what does it mean when you make a parent class abstract -> What does it mean when you make a specific method in a class abstract? Let's say we have these three classes: class Animal class Cat extends Animal ca. class Fish extends Animals void hunt(Animal animal) void eat(double amount) int numflegs double weight; double length; eat(animal weight); 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 mrMeow = new Cat(): or Animal mrMeow = new Cat(): (Hint: What properties and methods what be available in each case?) 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(); Give a reason why you might create you cats or fish as animals. Loss If you were just going to create Cats as Cats and Fish as Fish, do you gain anything from inheritance No contido not not partot animal to extend cats as Animal i saon at Circle the example of polymorphism in the code examples
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
