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
Is c# good for beginners?
What is difference between event and delegate in c#?
Explain the difference between directcast and ctype.
What is array collection?
Can abstract class have constructor in c#?
What is array c#?
Which compiler switch creates an xml file from xml comments in the files in an assembly?
Do loops c#?
What is a multi line comment?
You are designing a user control. You created new property called backgroundimage which is of type image. You wanted to disable storing this property in the user’s form. How to achieve this?
What is Global Assembly Cache (GAC) and what is the purpose of it? (How to make an assembly to public? Steps) How more than one version of an assembly can keep in same place?
What are value types and reference types?
What is the difference between delegates and superdelegates?
Can abstract class be sealed?
What is a dynamic assembly?