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 are upcasting and downcasting?

Answer Posted / vikram aditya

When reference variable of super class refers to the object of sub class that mechanism is known as Up-casting.
Ex:
A a=new B();

When reference variable of sub class refers to the object of super class that mechanism is known as Down-casting.
Ex:
B b=(B) a;

//Where A is super class and B is subclass
 

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain about java sdk?

963


Why can't we make a class private in java?

974


What is the base class of all classes?

983


what is use of functional interface in java 8?

974


What is linkedlist in java?

929


Explain the JDB in depth & command line.

958


How to disable caching on back button of the browser?

1003


From the two, which would be easier to write: synchronization code for ten threads or two threads?

998


How to create a thread in java?

1078


Difference difference paint() and paintcomponent()?

943


What Is Query Throttling in java?

955


Can we have multiple public classes in a java source file?

1095


How do I get 64 bit java?

1004


Why declare Main() method as a static in java ?

1018


What is procedure overloading?

2238