|
http://www.jindent.com |
Previous: QuestionsMarks
|
Next: Arrows
|
| 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: } |
| White space before colons in method references |

|
list.forEach(System.out·::println) |
|
list.forEach(System.out::println) |
| White space before colons in method references |

|
list.forEach(System.out::·println) |
|
list.forEach(System.out::println) |