Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is meant by UP& DOWN casting in java?

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


Please Help Members By Posting Answers For Below Questions

Is it possible for a yielded thread to get chance for its execution again?

999


How does hashmap work in java ?

1107


What is the difference between the size and capacity of a vector?

1102


What is outofmemoryerror in java?

1077


Is hashset ordered?

1128


What is thread pool in java with example?

1066


What is the advantage of OOP in java?

1207


What is callable java?

1039


What is regex in java?

993


Can I uninstall java?

1111


What is the difference between preemptive scheduling and time slicing?

1109


What is the definition of tree ?

1126


What is parsing in java?

1015


Is simpledateformat safe to use in the multithreaded program?

1052


What is the equal sign?

1197