Friday, November 20, 2009

Puzzle

What will be displayed on the screen when we write it (and why) ?

Action<string> a = Console.WriteLine;
var b = a;
var c = (a += Console.WriteLine);

a("Rx");
b("rulez");
c("!");

Hint: delegate type is:
- reference type
- immutable type

No comments: