Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have 3 Class

C#
Class a 
{
  a()}

ClassB:a
{
  B()}

Class c:B
{
  C()
}


So when i create class c object
Then what will be the sequence of constructer execution.

[EDIT]Original code has been kept - Maciej Los[/EDIT]
Posted
Updated 15-May-15 10:06am
v2
Comments
Sascha Lefèvre 15-May-15 9:47am    
Why don't you just test it yourself? There's absolutely nothing difficult about it to either put some Console.WriteLines in the constructors or watch it in the debugger.

1 solution

The sequence will be:
a(), then B() and then c()
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900