Create an abstract class 'Animals' with an abstract method 'sound'. Now create a class 'Cats' with a method 'sound' which prints "Cat’s meow" and a class 'Dogs' with a method 'sound' which prints "Dogs bark", both inheriting the class 'Animals'. Now access those methods by using base class pointer methods.
Answers
Answered by
0
Answer:
Create an abstract class 'Animals' with an abstract method 'sound'. Now create a class 'Cats' with a method 'sound' which prints "Cat’s meow" and a class 'Dogs' with a method 'sound' which prints "Dogs bark", both inheriting the class 'Animals'. Now access those methods by using base class pointer methods.
Explanation:
mark as BRAINLIEST answer
Answered by
1
animals make their own sounds
Similar questions