Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: some reordering of text

...

Declarations of loop indices should be included within a for statement even though this technically violates this guideline because the declaration is not on its own line with an explanatory comment)if that results in multiple variable declarations in that statement:

Code Block
bgColor#ccccff
public class Example {
  void function() {
    int mx = 100; // some max value

    for (int i = 0; i < mx; ++i ) {
      /* ... */
    }

  }
}

Such declarations are not required to be in a separate line and the explanatory comment may also be omitted.

Bibliography

...