A->B->C (EXTENDS)
How the constructors are called when we created an object of C
Answer Posted / 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 |
Post New Answer View All Answers
What is a thread? What is multithreading?
What is a collection in c#?
Explain how do I get deterministic finalization in c#?
Why do we need constructor?
What are the 2 broad classifications of fields in c#?
What does an indexer do?
Are c and c# the same thing?
How to do and Apply Themes to Datagrid,Lable,Textbox,etc., in C#.NET 2005 Windows Application? (like who we will do themes in ASP.NET using .CSS and .SKIN files). Urgent!!
Is class reference type c#?
What is wrong with the sample program below?
If casting fails what type of exception is thrown?
What is the difference between the debug class and trace class? Documentation looks the same.
What is the difference between first and firstordefault?
What is the difference between system.text.stringbuilder and system.string?
Can we override interface methods in c#?