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...

There are a class A. Another class B derived from it.
Now if I do A a = new B(); and B b = new B(); What will
happen in both the statements. And what is the difference
between these two statements.

Answer Posted / srushtitha.

here,A is Base class, B is Derived class.
in the first statement "the object of B is stored in parent
clss reference"(Runtime Polymorphism).

-->In the secend statement "the object is creacted for the
child class.

Is This Answer Correct ?    23 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the types of comment in c# with examples?

921


Why do we need singleton pattern in c#?

959


Why do we need nullable types in c#?

1167


Why do we use constructors in c#?

1119


What is serialization in c#?

906


What is thread pooling?

969


What is deadlock in c#?

943


Why cannot you specify the accessibility modifier for methods inside the interface?

918


What is the task perform by clr?

1049


Why objects are stored in heap in c#?

949


Explain deadlock?

1005


What is a long in c#?

1033


What is the purpose of namespace in c#?

874


Is object an int c#?

928


Differentiate between method overriding from method overloading with its functionality?

1028