Answer Posted / sabeetha
Down Casting is nothing but casting down the inheritance
tree to a more specific class i.e casting a superclass to
subclass.
Upcasting- casting up the inheritance tree to a more general
type. It is done implicitly (i.e typing in the cast is not
required). Its because the classes at lower level of
hierarchy have all those features that are present in the
classes above them in the inheritance hierarchy. So they can
be upcasted implicitly ( like Dog IS-A Animal).
I got this answer
from(http://javaforyou.wordpress.com/2008/06/22/casting-reference-variables-downcasting-upcasting/)
with example.
| Is This Answer Correct ? | 19 Yes | 2 No |
Post New Answer View All Answers
What is the do while loop syntax?
What is the concatenation operator in java?
Is minecraft java edition free?
What is singleton service?
Which of the following classes will have more memory allocated?
How many types of design patterns are there?
Explain the private protected method modifier?
What is java oops?
Can we print null in java?
Which is better arraylist or vector?
Explain throw keyword in java?
What is a function in java?
Explain features of interfaces in java?
What is a control variable example?
What is the difference between a field variable and a local variable?