Why is this c# snippet legal?

Posted by Sir Psycho on Stack Overflow See other posts from Stack Overflow or by Sir Psycho
Published on 2010-03-02T06:24:05Z Indexed on 2010/03/08 21:06 UTC
Read the original article Hit count: 291

Filed under:
|
|

Silly question, but why does the following line compile?

int[] i = new int[] {1,};

As you can see, I haven't entered in the second element and left a comma there. Still compiles even though you would expect it not to.

© Stack Overflow or respective owner

Related posts about c#

Related posts about trailing-character