What is the difference between up-casting and down-casting with respect to class variable?
For example in the following program class Animal contains only one method
Maybe this table helps. Calling the callme() method of class Parent or class Child. As a principle:
callme()
Parent
Child
UPCASTING --> Hiding DOWNCASTING --> Revealing
UPCASTING --> Hiding
DOWNCASTING --> Revealing