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
What are the types of comment in c# with examples?
Why do we need singleton pattern in c#?
Why do we need nullable types in c#?
Why do we use constructors in c#?
What is serialization in c#?
What is thread pooling?
What is deadlock in c#?
Why cannot you specify the accessibility modifier for methods inside the interface?
What is the task perform by clr?
Why objects are stored in heap in c#?
Explain deadlock?
What is a long in c#?
What is the purpose of namespace in c#?
Is object an int c#?
Differentiate between method overriding from method overloading with its functionality?