Thursday, January 04, 2007 12:52 PM bart

C# Quiz - Field initialization (cont'd)

In yesterday's post for this quiz, I asked for the difference between two little code fragments. Let's take it one step further today, so take a look at the following:

Can you predict the output of the application? And why do you observe that particular output?

Stay tuned for the answer tomorrow!

Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

Filed under:

Comments

# re: C# Quiz - Field initialization (cont'd)

Thursday, January 04, 2007 3:00 PM by Eber Irigoyen

0 123 Bar1 initialization of i happens until after the base constructor is called Bar2 initializes it before the constructor is called

# re: C# Quiz - Field initialization (cont'd)

Friday, January 05, 2007 1:17 AM by Ramon Smits / Exyll

Nice way of showing the behavior of yesterdays example :). Eber his solution is correct AFAIK.

# Answers to C# Quiz - Field initialization

Monday, January 08, 2007 1:20 PM by B# .NET Blog

A few days ago I posted the following two posts for this C# Quiz: C# Quiz - Field initialization C# Quiz