Category Archives: Type Casting

Object Types Casting

Instances of classes also can be cast into instances of other classes if one class is a subclass of the other.
That is, you can cast an object only to an instance of its class’s sub- or superclass. Casting downward in the class hierarchy is automatic, but casting upward is not.
Read more