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
What is yield return in c#?
How many digits is a 32 bit number?
What are the types of inheritance in c#?
What is the difference between icomparer and icomparable in c#?
What is mean by c#?
List some Advantages of switch-case over if else?
What is writeline?
Explain how to implement an object pool in c#.net
Hi Friends, I am going through Siemens Interview Procedure from last 1+1/2 months. I went through 1 written + 2 Technical + 1 Managerial Round process after which I got call from HR informing that "you are selected and we would like to meet you for HR round". HR round was very nominal compared to MR. HR Round last for hardly 5 mins. They told me that you will get the final result on Friday. Still I have not received any feedback from them. Please help!!!
What is array class in c#?
What is xamarin used for?
What is the root element of an xml file?
What is a deadlock lock?
Does c# provide copy constructor?
What is a delegate? How can it works?