Advertisement
Guest User

readonly is not final

a guest
Jun 1st, 2012
861
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.15 KB | None | 0 0
  1. void Main() {
  2.     Console.WriteLine (new Foo().val); //output: 2
  3. }
  4.  
  5. class Foo {
  6.     public readonly int val = 1;
  7.    
  8.     public Foo() {
  9.         this.val = 2;
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement