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.
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|
Can you instantiate a struct without using a new operator in c#?
How to assign Null value to Var?
How to sign an assembly with strong name?
I want to print "Hello" even before main() is executed. How will you achieve that?
What is the ouput of the following program?
From which base class do all Web Forms inherit from?
Compare and contrast between the System.Array.CopyTo() and Clone()?
Explain about CTS?
Is it possible to restrict the scope of a field/method of a class to the classes in the same namespace?
What are the 3 different types of arrays?
What is type cast in C#?
how background thread access to ui control?
What is difference between C# and VB.NET?
What are destructors in C#?
Which namespace is required to implement trace ?