-
-
Notifications
You must be signed in to change notification settings - Fork 348
Variables
Isfirs edited this page Aug 23, 2016
·
5 revisions
- Named in
lowerCamelCase
convention.
- Declare variables close to the location where they are used.
- If you get some
getXY()
method to store a reference to anObject
, centralize thevariable
/**/
public void someMethod( )
{
final Object object = other.getObject();
if ( checkCondition( ) )
{
object.someMethod( );
}
else {
object.otherMethod( );
}
}
/**/
- Declare
once instanciated
variables asfinal
.
/**/
public void someMethod( )
{
final String neverChanged = "foobar";
// Other method content
}
/**/