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


Please Help Members By Posting Answers For Below Questions

What is the meaning of MSIL?

6


Explain the Usage of web.config

2


Can you call from an inherited constructor to a specific base constructor if both base class and an inheriting class has a number of overloaded constructors?

1


What are the Types of compatabilities and explain them

1


write code for inserting and updating recoards in sql server database using connected architecture & records shoulds displayed in grid view ( use c# )

1330






What is garbage collector and where should you use in .NET?

2


if we are updating a database using thread, and mean while application crashes or thread being aborted then what will happen in Database? Rollback or Database will be updated? Please explain with different scenario.

1305


Whats an assembly? Describe the importance of assembly?

1


How to create multi-dimensional array?

3


Which is executed if an exception has not occurred?

3


What exactly happens when we debug and build the program?

1564


Explain About namespaces

4


what is be the overhead, if i use binary transmission. and will it be sent using xml text or how ?

1133


i want o/p 011242110 in c# code.

991


Explain About Assembly in .NET, types of assemblies, their difference, How to register into GAC. How to generate the strong names & its use.

3