Free help with homework

Why join Brainly?

  • ask questions about your assignment
  • get answers with explanations
  • find similar questions


Down casting 

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;

1 5 1
The Brain
  • The Brain
  • Helper
Not sure about the answer?
Learn more with Brainly!
Having trouble with your homework?
Get free help!
  • 80% of questions are answered in under 10 minutes
  • Answers come with explanations, so that you can learn
  • Answer quality is ensured by our experts