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

What is static keyword in java?

1057


What is the default access specifier for variables and methods of a class?

1253


What is a treeset class?

1060


What is the purpose of using java.lang.class class?

1058


What is unicode full form?

1034


What is the final class?

1126


what is the difference between process and thread? : Java thread

1023


What are the advantages of encapsulation in java?

1051


what is use of functional interface in java 8?

1094


What is meant by singleton class?

1080


How do you generate random numbers in java?

1064


What is anti pattern in programming?

1011


Why are there no global variables in java?

1108


Is map ordered in java?

995


Hi i am creating desktop application in that i want calling to mobile number. i have java telephone api (JTAPI) but i dont understand how it configure & use plese help me

1897