A->B->C (EXTENDS)
How the constructors are called when we created an object of C
Answers were Sorted based on User's Feedback
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 |
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 |
Is the following code legal?
how can i return string by vilating duplicates(inpyt like asdfsda but output should be 2a2d2sf and 2a,2d,2s,f)
Is and as in c#?
What are the 2 kinds of data type conversions in c#?
What?s a satellite assembly?
Difference between ByVal and ByRef?
How to raise an selection changed event associated with listbox in datagridview control with a sample example?Here the listbox is a child control associated with datagridview control.
What is the use of system.environment class in c#.net?
what is the real use of interface in c#,other than that multiple inheritance is not possible
Difference between type constructor and instance constructor? What is static constructor, when it will be fired? And what is its use?
what is c# command?
Why we use anonymous methods in c#?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)