A->B->C (EXTENDS)
How the constructors are called when we created an object of C

Answers were Sorted based on User's Feedback



A->B->C (EXTENDS) How the constructors are called when we created an object of C..

Answer / ramkishore mateti

When you intantiate Class C then the Class C Constructor
calls its base class(class b) constructor, Class b calls
its baseclass constructor i.e Class a, Class a calls its
base class constructor System.object.System.object
intiallizes class fields, then it comes to Class a it
intializes thier class fields and it comes to Class b after
intilalizion at last the Class C constructor intializes
their class fields.
Hence the Hierarchy of class Constructors are called are
a , b, c

Is This Answer Correct ?    11 Yes 1 No

A->B->C (EXTENDS) How the constructors are called when we created an object of C..

Answer / kiran

constructor are called in this order
a,b,c

Is This Answer Correct ?    7 Yes 2 No

A->B->C (EXTENDS) How the constructors are called when we created an object of C..

Answer / priya

the constructor of class A is called first then Class B and
at the end class C.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

What?s different about switch statements in C#?

2 Answers  


What is data types in c#?

0 Answers  


What is the adv of using System.Text.StringBuilder over System.String?

0 Answers   Siebel,


What is the Difference between imperative and interrogative code?

2 Answers   Wipro,


What is default method in c#?

0 Answers  






If I have code like try { return; } catch { return; } finally { return; } from which block will the value will be returned. and try has been executed without any error.

6 Answers   Cap Gemini,


Which property of the textbox cannot be changed at runtime?

0 Answers  


Tell me the difference between value passing and address passing?

0 Answers   NIIT,


what is read only and constant

8 Answers   FIC, IBM,


what are nullable types in c#

0 Answers   Cognizant,


what are wrapper classes?

1 Answers  


Define Virtual folder?

0 Answers   Arigo Infotech,


Categories