In object-oriented programming,downcasting or type refinement is the
act of casting a reference of a base class to one of its derived
classes.
In many programming languages,it is possible to check through type
introspection to determine whether the type of the referenced object
is indeed the one being cast to or a derived type of it,and thus
issue an error if it is not the case.
In other words,when a variable of the base class (parent class) has a
value of the derived class (child class),downcasting is possible.