โ Back to Inheritance
Question 502
Bird Inherits From Animal
Bird Inherits From Animal
The base classAnimalalready defines aBreathe()method that printsBreathing. Make theBirdclass inherit fromAnimalso aBirdobject can call the inheritedBreathe()method. Do NOT write aMainmethod. When the tester creates aBirdand callsBreathe(), the program prints: Breathing
Expected Output:
Breathing
Topics:
Inheritance
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cw, cr, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.