An empty statement is a single semicolon ; that does not terminate another statement. Such a statement hinders readability and has no effect on its own.

Avoid empty statements. If a loop is intended to have an empty body, it is better to mark that fact explicitly by using a pair of braces {} containing an explanatory comment for the body, rather than a single semicolon.

In the following example, there is an empty statement on line 3, where an additional semicolon is used. On line 6, the for statement has an empty body because the condition is immediately followed by a semicolon. In this case, it is better to include a pair of braces {} containing an explanatory comment for the body instead.

  • Help - Eclipse Platform: Java Compiler Errors/Warnings Preferences.