You are on page 1of 1

?

= is used to type cast an object reference of an inherited class to an object of


the super class from which it is derived.

<object reference of parent calss> ?= <object reference of inherited class>

Type casting helps you to refer several object references of sub classes whose type
is resolved only at run time. The parent class object reference can hold the
objects and often there would be a method of parent class which can be used to
determine what sub class object the type cast reference is holding at run time.

You might also like