|
http://www.jindent.com |
Previous: Blank Lines
|
Next: Switch-Case Blocks
|
| Blank lines before statements containing blocks |

|
a = callMethod(); a++; ¶ if (a < 10) { ... } |
|
a = callMethod(); a++; if (a < 10) { ... } |
|
public void method() { do { ... } while(x < n); ¶ a = callMethod(); a++; ¶ if (a < 10) { ... } ¶ callOtherMethod(); } |
| Blank lines after statements containing blocks |

|
do { ... } while(x < n); ¶ a = callMethod(); a++; |
|
do { ... } while(x < n); a = callMethod(); a++; |
|
public void method() { do { ... } while(x < n); ¶ a = callMethod(); a++; ¶ if (a < 10) { ... } ¶ callOtherMethod(); } |
| Insert blank lines between different statement types |

|
public void main() { System.out.println("Hello World !"); // method call callMethod(); // method call a = getSomething(); // assingment b = a + 1; // assingment callAnotherMethod(a, b); // method call callEvenMoreMethods(); // method call a++; // expression ... } |
|
public void main() { System.out.println("Hello World !"); // method call callMethod(); // method call ¶ a = getSomething(); // assingment b = a + 1; // assingment ¶ callAnotherMethod(a, b); // method call callEvenMoreMethods(); // method call ¶ a++; // expression ... } |
| Blank lines before branching statements (break, continue, return, throw) |

break, continue, return and throw).|
public int getA() { int x = callMethod(); x = x + 10; ¶ return x; } |
|
public int getA() { int x = callMethod(); x = x + 10; return x; } |