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 |
What is array formula?
What is the main purpose of delegates in c#?
What is Implementation inheritance and interface inheritance?
Why attributes are used in c#?
What is difference between gridview and form view?
Is there any sample c# code for simple threading?
What is short in c#?
What are regular expressions? Search a string using regular expressions?
What is the purpose of a namespace?
What is lazy keyword in c#?
In which situation(s), the use of "Delegate" is a good idea?
What is the advantage of generics in c#?