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 data types with examples?
What are the principles of delegation?
What is parsing?
In languages without exception-handling facilities, we could send an error-handling procedure as a parameter to each procedure that can detect errors that must be handled. What disadvantages are there to this method?
What is func delegate in c#?
Is .net and c# the same?
In a single .NET DLL how many classes it contains?
What are the different types of classes?
What is a hash table in c#?
What is xml c#?
What is a byte in c#?
What is eager and lazy loading in c#?
Why can't we use a static class instead of singleton?
Should I use double or float?
What is c# console application?