Well, a not an instance of Cat . If you want to drag it into Cat , you need to create Cat (or an instance of some class that extends Cat , of course):
Animal a = new Cat();
Note that if Animal declares makePee() and Cat cancels it, then downcasting is pointless. You can simply call a.makePee() , and the Cat implementation will be used (if you really created Cat , as mentioned above).
source share