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
How many types of java are there?
Is {a, n, d} a palindrome? If you are given a random string, is it a palindrome or not?
How do you know if a value is nan?
Can we override the overloaded method?
Is constructor inherited?
What are void methods?
How will you load a specific locale?
What are the main differences between notify and notifyAll in Java?
When do you call copy constructor?
What are 5 boolean operators?
Explain when classnotfoundexception will be raised ?
What is 16 bits called?
Do I need java for windows 10?
What is the use of object and class classes?
which is advanced deep technology in java launched by the sun microsystem??? The answer is very logical If u need correct answer mail me at priya_gupta@gmail.com