title: wrong enum value in C#
body: <p>Why is the following printing <code>EOF</code> as the output and not <code>ILLEGAL</code>? If I remove the initialization for EOF to NULL character, it works as expected. Can't understand what is happening here?</p>
  <pre><code>public enum TokenType {
              ILLEGAL,
              EOF= '\0',//remove the initialization to have it work as expected
              IDENT,
              INT
              };
  
  void Main()
  {
      Console.WriteLine(TokenType.ILLEGAL);//Prints EOF. Should have printed ILLEGAL
  }
  </code></pre>