Q:

Double semi colon ( ; ; ) allowed in C#.net?

I accidentally put two semi colon at the end of a statement while writing some code. I was amazed that it didn't gave any error. I mean what is the purpose of allowing double semi colon? What it actually means and how it can be useful at any particular programming method?

A:

Because ; is just an empty statement in other words null statement. It's usually useless but completely valid.
This is used in loops where you want to perform something repeatedly but do not want to add a loop body.As shown in the below example:
for ( i = 0; i < 10; line[i++] = 0 )
 ;

In your case however, first semicolon is the end of the statement, second one is the empty statement.Which is useless and will be ignored by the compiler.

