CJCoding With Joseph

Abstract Name Property

An abstract class can declare an abstract property that every subclass must supply. Animal declares an abstract read-only property Name and a concrete Announce() that prints I am a  followed by Name. Override Name in Lion so its getter returns Lion. Do NOT write a Main method.

When the tester calls Announce() on a Lion, the program prints:
I am a Lion

Expected Output:

I am a Lion
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.