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
Which software is used for java programming?
What is assembly condition codes?
What is the final variable?
What are the basic concepts of OOPS in java?
What is the primary benefit of encapsulation?
What are variable arguments or varargs?
What are the different types of data structures in java?
What package is math in java?
Why hashmap is used in java?
What is a java string?
What is * argv?
What is the protected method modifier?
Explain about serializable interface in java?
What is stringjoiner ?
What Is Query Throttling in java?