I am writing a statement and it compiles, but the compiler [VS] never tells me that I put the semicolon two times.
This means in ASP.NET MVC 3
return Json(mydata);;
return Json(mydata);
Both of them compile, but the first is wrong in design pattern. Why doesn't it tell me about the two semicolons.
If there is no reason to use two semicolons, why doesn't it show an error?
If there is a special use of it, please show me where two semicolons is required to write a statement in C#.
; - statement separator. Double semicolon contains empty statement, which do nothing.
Using empty statement:
Or
As you can see, this behavior is correct. But in your example you will have unreachable code with empty statement.