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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!