The information on this page is for Archive Purposes Only This page is not being actively maintained. Links within the documentation may not work and the information itself may no longer be valid. The last revision to this document was made on April 20, 1999 |
Blank lines improve readability by setting off sections of code that are logically related.
Two blank lines should always be used in the following circumstances:
One blank line should always be used in the following circumstances:
Blank spaces should be used in the following circumstances:
while (true) {
...
}
Note that a blank space should not be used between a method name and its opening parenthesis. This helps to distinguish keywords from method calls.
.
should be separated from their operands by spaces. Blank spaces should never separate unary operators such as unary minus, increment ("++"), and decrement ("--") from their operands. Example:
a += c + d;
a = (a + b) / (c * d);
while (d++ = s++) {
n++;
}
printSize("size is " + foo + "\n");
for (expr1; expr2; expr3)
myMethod((byte) aNum, (Object) x);
myMethod((int) (cp + 5), ((int) (i + 3))
+ 1);