最佳答案
Today, after half an hour of searching for a bug, I discovered that it is possible to put a semicolon after an if statement instead of code, like this:
if(a == b);
// Do stuff
Which basically means that the stuff will be done whether a
equals b
or not, and the if
statement has no point whatsoever. Why doesn't Java give me an error? Is there any situation in which this would be useful?