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 is the difference between yield and return?

460


What is window application in c#?

494


What is marshalling in c#?

478


How do you concatenate in c#?

487


how to prevent a class from being inherited in c#.net?

510






What are reflections in c#?

489


Is overriding of a function possible in the same class?

467


What is Wrapper class in dot net?

631


What is string programming language?

439


What do you mean by string objects are immutable?

502


Should I make my destructor virtual?

574


How do I download a program to my desktop?

461


What is disconnected data architecture in c#?

479


What is the purpose of a console table?

471


Does c# support multilevel inheritance?

483