I have my next question.
I have extended a class, Parrent and overridden one of its method in the Child class. I tried to cast the type to the supercla
The actual type is Child, therefore when you call a method, the Child's method will be called. It doesn't matter whether the reference type is of Parent, it's the actual type of the object that matters.
You can't "cast to superclass" in order to call the Parent's method either.