且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么Java在语句结尾处不显示双分号错误?

更新时间:2022-06-16 09:22:31

因为双分号不是双分号,而是分号加空语句。并且一个没有任何作用的空语句不是错误。

Because a double semicolon is not treated as a double semicolon but as a semicolon plus an empty statement. And an empty statement, which does nothing, is not an error.