2. [Mandatory] No space is used between the ‘(‘ character and its following character. Same for the ‘)’ character and its preceding character. Refer to the Positive Example at the 5th rule.
3. [Mandatory] There must be one space between keywords, such as if/for/while/switch, and parentheses.
4. [Mandatory] There must be one space at both left and right side of operators, such as ‘=’, ‘&&’, ‘+’, ‘-‘, ternary operator, etc.
5. [Mandatory] Each time a new block or block-like construct is opened, the indent increases by four spaces. When the block ends, the indent returns to the previous indent level. Tab characters are not used for indentation.
6. [Mandatory] Java code has a column limit of 120 characters. Except import statements, any line that would exceed this limit must be line-wrapped as follows:
1) The second line should be intented at 4 spaces with respect to the first one. The third line and following ones should align with the second line.
2) Operators should be moved to the next line together with following context.
3) Character ‘.’ should be moved to the next line together with the method after it.
4) If there are multiple parameters that extend over the maximum length, a line break should be inserted after a comma.
5) No line breaks should appear before parentheses.
7. [Mandatory] There must be one space between a comma and the next parameter for methods with multiple parameters.
9. [Recommended] It is unnecessary to align variables by several spaces.
10. [Recommended] Use a single blank line to separate sections with the same logic or semantics.