The semicolon (;
) is optional as a statement separator except in traditional for
loops and when several statements are
combined on one line (which is a bad practice). For cleaner code, semicolons should be omitted.
Noncompliant code example
int a; // Noncompliant
Compliant solution
int a