CJCoding With Joseph

Classify By Runtime Type

Complete Classifier.Classify so it returns Dog, Cat, or Unknown depending on the actual runtime type of the Animal passed in. Use a type-pattern switch. Do NOT write a Main method.

For a Dog, a Cat, and a plain Animal the program prints:
Dog
Cat
Unknown

Expected Output:

Dog
Cat
Unknown
Topics:
Polymorphism
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.