Upcasting and downcasting in Java

Casting : Taking an object of one type and assigning it to reference variable of another type. Upcasting : Object of child class is assigned to reference varibale of parent type. Example : class A{     } class B extend A{     } class A{ } class B extend A{ } A a1 […]

Share this article on
< Previous