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 / ashok kumar
A is a base class, B is a derived class.
Which means we cad access all the data of A class in B class.
Public A
{...}
Public B:A
{...}
Class VoidMain()
{
A a=new B();// Creating object for A class(can access the A
class data only).
B b=new B();// Creating object for B class(can access the
A,B class data).
}
| Is This Answer Correct ? | 12 Yes | 3 No |
Post New Answer View All Answers
How garbage collection deals with circular references.
What is the difference between integer and double?
How do you serialize an object?
What is session c#?
How do I move from one form to another in c#?
What is the difference between ienumerable and enumerator?
How do I create a dbml file?
How big is an int16?
how encapsulation is implemented in c#
How to find out that the code is written as managed or un-managed code?
When would you use generics in your code c#?
What is the example of predicate?
List down the differences between public, static and void keywords?
What's the difference between an integer and int?
What is called method in c#?