Java Coding Standards in a Nutshell by Marcus Stuart

Java Coding Standards in a Nutshell by Marcus Stuart

Author:Marcus Stuart [Stuart, Marcus]
Language: eng
Format: azw3
Publisher: UNKNOWN
Published: 2017-10-27T04:00:00+00:00


Return statement

Do not use parentheses around the value to be returned unless it is a complex expression

return(true); // WRONG

return true; // RIGHT

9.2 Compound Statements

9.2.1. Braces style

Compound statements are statements that contain a statement block enclosed in “{}” braces. All compound statements follow the same braces style; namely, the style commonly known as the “K & R” braces style. This includes interface, class and method declarations. This style is specified as follows:

· The opening left brace is at the end of the line beginning the compound statement.

· The closing right brace is alone on a line, indented to the same column as the beginning of the compound statement.

· The statements inside the enclosed braces are indented one more level than the compound statement.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.