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

Difference between static and dynamic class loading.

1102


Does java initialize arrays to zero?

1016


What is a JAR file?

1029


How is string stored in java?

1046


What is size () in java?

1077


Is age discrete or continuous?

1109


Can private members of a base class are inheritable justify?

907


How can you traverse a linked list in java?

1114


What are the steps in the jdbc connection?

1001


What is difference between string and stringbuffer?

1070


What are the basic interfaces of java collections framework?

1100


how to split string in java?

1195


What is the final field modifier?

962


What is Java Shutdown Hook?

1175


Why string is immutable with example?

954