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

How can we find the actual size of an object on the heap?

1316


What is runtime polymorphism or dynamic method dispatch?

1015


Is arraylist sorted in java?

1007


Do loops java?

1023


What are the files generated after using IDL to java compiler?

1150


What is a blocking method in Java?

1249


Add a value x to array from index l to r where 0 <= l <= r <= n-1

1095


What is main difference between variable and constant?

1038


How do you convert int to char in java?

1074


What is lifetime variable?

964


What is an argument java?

976


Does chrome use java?

975


What is formatted output?

963


Differece between class and generic class?

1046


What is static synchronization?

1106