...
Code Block | ||
---|---|---|
| ||
public class Example { private T a; // purpose of a... private T b; // purpose of b... private T[] c; // purpose of c[]... private T d; // purpose of d... public Example(T in){ a = in; b = in; c = (T[]) new Object[10]; d = in; } } |
Exceptions
DCL01-EX0EX1: Note that the declaration of a loop counter in a for
statement is in violation of this guideline because the declaration is not on its own line with an explanatory comment about the variable's role. However, declaration of loop indices in for
statements is not only a common idiom; it also provides the benefit of restricting the scope of the loop index to the for
loop itself. This is a specific reason to relax this guideline.
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="343bb764059cc907-be661cd2-49d44be8-aa6d91f5-f62499633a623770a3b712b8"><ac:plain-text-body><![CDATA[ | [[Conventions 2009 | AA. Bibliography#Conventions 09]] | Section 6.1, "Number Per Line" | ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="06c69995722ee9fa-22f4ec8f-42a7450b-8198ab5f-e778127ae1e77d4c3901c87d"><ac:plain-text-body><![CDATA[ | [[ESA 2005 | AA. Bibliography#ESA 05]] | Rule 9: Put single variable definitions in separate lines. | ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="26f6faf024d4b639-57961dda-41f54bdb-a76f919d-2da1bf4e4d63296d89a62940"><ac:plain-text-body><![CDATA[ | [[JLS 2005 | AA. Bibliography#JLS 05]] | [§8.3, "Field Declarations" | http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.3] | ]]></ac:plain-text-body></ac:structured-macro> |
| |||||
| |||||
| |||||
|
...