Upcasting and Downcasting in Java with Example
When the reference variable of superclass refers to the object of subclass, it is known as upcasting in Java. In other words, when the subclass object type is converted into the superclass type, this type of conversion is called upcasting. It is also called widening in Java. Look at the … Read more