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. Ex: class A{} class B extend A{} A a1 = new B(); this operation is a upcasting. and it happens automatically.no need to do […]

Share this article on
< Previous