The answer is 1000.
In the following statement, the struct c is cast to a reference:
| ((Employee)c).GiveRaise(50);
|
This involves boxing. A copy of c is made, and the GiveRaise
method is called on that copy, not on the original object.
Removing the cast will produce the expected answer.
More information is available under structs and
boxing.
[Back to Index]
|