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?


Explain the Usage of web.config


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?


What are the Types of compatabilities and explain them


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


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


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.


Whats an assembly? Describe the importance of assembly?


How to create multi-dimensional array?


Which is executed if an exception has not occurred?


What exactly happens when we debug and build the program?


Explain About namespaces


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


i want o/p 011242110 in c# code.


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