|
http://www.jindent.com |
Previous: White Spaces
|
Next: Blank Lines
|
| Parentheses |
| Space before left parentheses of constructor and method declarations |

|
public·void·methodA·(int·param) { ... } |
|
public·void·methodA(int·param) { ... } |
| Space before left parentheses of constructor and method calls |

|
if·(a·<·10) { callMethod·(a); } |
|
if·(a·<·10) { callMethod(a); } |
| Space before left parentheses of annotation type member declarations |

|
@interface·RequestForEnhancement { int·id·(); String·synopsis·(); } |
|
@interface·RequestForEnhancement { int·id(); String·synopsis(); } |
| Space before left parentheses of single-member annotations |

|
@Copyright·("2002·Yoyodyne·Propulsion·Systems,·Inc.,·All·rights·reserved.") public·class·ClassA·{ ... } |
|
@Copyright("2002·Yoyodyne·Propulsion·Systems,·Inc.,·All·rights·reserved.") public·class·ClassA·{ ... } |
| Space before left parentheses of normal annotations |

|
@RequestForEnhancement·(id=2868724,·synopsis="Provide·time-travel·functionality") public·float·methodA()·{ ... } |
|
@RequestForEnhancement(id=2868724,·synopsis="Provide·time-travel·functionality") public·float·methodA()·{ ... } |
| Space before left parentheses of for statements |

for statements or not.|
for·(int·i·=·0;·i·<·n;·i++)·{ ... } |
|
for(int·i·=·0;·i·<·n;·i++)·{ ... } |
| Space before left parentheses of if statements |

if statements or not.|
if·(a·<·10)·{ ... } |
|
if(a·<·10)·{ ... } |
| Space before left parentheses of while statements |

while statements or not.|
while·(i·<·10)·{ ... } |
|
while(i·<·10)·{ ... } |
| Space before left parentheses of catch statements |

catch statements or not.|
try·{ ... }·catch·(Exception·e)·{ ... } |
|
try·{ ... }·catch(Exception·e)·{ ... } |
| Space before left parentheses of switch statements |

switch statements or not.|
switch·(a)·{ case·1·: ... } |
|
switch(a)·{ case·1·: ... } |
| Space before left parentheses of synchronized statements |

synchronized statements or not.|
synchronized·(a)·{ ... } |
|
synchronized(a)·{ ... } |
| Space before left parentheses of enum constants |

enum constants or not.|
enum·Nummer·{ EINS·(1),·ZWEI·(2),·DREI·(3),·VIER·(4) } |
|
enum·Nummer·{ EINS(1),·ZWEI(2),·DREI(3),·VIER(4) } |
| Space before left parentheses of throw statement |

throw statements or not.throw statements
as method calls.)|
throw·(new·MyException()) |
|
throw(new·MyException()) |
| Space before left parentheses of return statement |

return statements or not.return statements
as method calls.)|
return·(value); |
|
return(value); |
| Space before left parentheses of assert statement |

assert statements or not.|
assert·(a·<·10); |
|
assert(a·<·10); |
| Space after right parentheses of castings |

|
int·value·=·(int)·floatValue; |
|
int·value·=·(int)floatValue; |
| Brackets |
| Space before brackets |

|
int·value·=·intArray·[index]; |
|
int·value·=·intArray[index]; |
| Space before brackets in types |

|
int·intArray·[]; |
|
int·intArray[]; |
| Braces |
| Space before left braces of array initializers |

|
int·intArray·[]; |
|
int·intArray[]; |
| Complement Operators |
| Space before bangs |

|
if(·!(x·==·3)){ callMethodC(); } |
|
if(!(x·==·3)){ callMethodC(); } |
| Space after bangs |

|
if(!·(x·==·3)){ callMethodC(); } |
|
if(!(x·==·3)){ callMethodC(); } |
| Space before bangs appearing together with && || |

&&)/or (||) conditions or not.|
if(((w==y)·||·!(w>=0))·&&·!(w<y))·{· ... } |
|
if(((w==y)·||!(w>=0))·&&!(w<y))·{· ... } |
| Space after bangs appearing together with && || |

&&)/or (||) conditions or not.|
if(((w==y)·||!·(w>=0))·&&!·(w<y))·{· ... } |
|
if(((w==y)·||!(w>=0))·&&!(w<y))·{· ... } |
| Space before tildes |

|
byte·u·=·~1; |
|
byte·u·=~1; |
| Space after tildes |

|
byte·u·=·~1; |
|
byte·u·=·~·1; |
| Colons |
| Space before colons of assert statements |

|
assert·condition·:"Error" |
|
assert·condition:"Error" |
| Space after colons of assert statements |

|
assert·condition:·"Error" |
|
assert·condition:"Error" |
| Space before colons of for statements |

for statements or not.|
for(String·s·:collection)·{ ... } |
|
for(String·s:collection)·{ ... } |
| Space after colons of for statements |

for statements or not.|
for(String·s:·collection)·{ ... } |
|
for(String·s:collection)·{ ... } |
| Space before colons of ternary conditions |

|
int·x·=·(a·==·0)·?·b·:·c; |
|
int·x·=·(a·==·0)·?·b:·c; |
| Space after colons of ternary conditions |

|
int·x·=·(a·==·0)·?·b·:·c; |
|
int·x·=·(a·==·0)·?·b·:c; |
|
See also: | Space before question marks of ternary conditions , Space after question marks of ternary conditions |
| Space before colons of labels |

|
myLabel·:···while·(a·<·10)·{ ···············... ···············break·myLabel; ···············... ············} |
|
myLabel:····while·(a·<·10)·{ ···············... ···············break·myLabel; ···············... ············} |
| Space after colons of labels |

|
myLabel:·while·(a·<·10)·{ ···... ···break·myLabel; ···... } |
|
myLabel:while·(a·<·10)·{ ···... ···break·myLabel; ···... } |
| White space before colons in switch-case blocks |

case colons or not.|
switch(a)·{ ····case·1·: ········System.out.println("one"); ········break; ····case·2·: ········System.out.println("two"); ········break; ····case·3·: ········System.out.println("three"); ········break; ····default·: } |
|
switch(a)·{ ····case·1: ········System.out.println("one"); ········break; ····case·2: ········System.out.println("two"); ········break; ····case·3: ········System.out.println("three"); ········break; ····default: } |
| Commas |
| Space before commas |

|
public·void·method(int·a·,int·b)·{ callMethod(a·,·b); } |
|
public·void·method(int·a,int·b)·{ callMethod(a,b); } |
| Space after commas |

|
public·void·method(int·a·,·int·b)·{ callMethod(a·,·b); } |
|
public·void·method(int·a,int·b)·{ callMethod(a,b); } |
| Ellipses |
| Space before ellipses |

|
void·method(String·s,·Object·...·args)·{ ... } |
|
void·method(String·s,·Object...·args)·{ ... } |
| Semicolons |
| Space before semicolons |

|
int·x·=·0·; callMethod(x)·; |
|
int·x·=·0; callMethod(x); |
| Space before semicolons of for statements |

for statements or not.|
for·(int·i=0·;i<n·;i++)·{ ... } |
|
for·(int·i=0;i<n;i++)·{ ... } |
| Space after semicolons of for statements |

for statements or not.|
for·(int·i=0;·i<n;·i++)·{ ... } |
|
for·(int·i=0;i<n;i++)·{ ... } |
| Do not insert spaces into empty for statements |

for statements or not.|
for·(·;·;·)·{ ... } |
|
for·(;;)·{ ... } |
| Question Marks |
| Space before question marks of ternary conditions |

|
int·x=(a==0)·?b:c; |
|
int·x=(a==0)?b:c; |
| Space after question marks of ternary conditions |

|
int·x=(a==0)?·b:c; |
|
int·x=(a==0)?b:c; |
|
See also: | Space before colons of ternary conditions , Space after colons of ternary conditions |