upcasting and downcasting examples. Some commonly used default string method. (JAVA)
Home
/
Computer Science
/
upcasting and downcasting examples. Some commonly used default string method. (JAVA)
upcasting and downcasting examples. Some commonly used default string method. (JAVA)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
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;