1.

Upcasting and downcasting examples. Some commonly used default string method. (JAVA)

Answer»

sting ANIMAL animal = NEW DOG();Dog dog = (Dog) animal;here animal is a higher variable type and dog is lower. Then we down casting animal as Dog type in SECOND line.Up casting will be opposite ...Circle circ = new Circle();SHAPE shape = (Shape) circ;



Discussion

No Comment Found