Downcasting with java instanceof operator
When Subclass type refers to the object of Parent class, it is known as downcasting.
If we perform it directly, compiler gives Compilation error.
If you perform it by typecasting, ClassCastException is thrown at runtime. But if we use instanceof operator, down casting is possible.