MISC.FF
Constant fields should be declared as "final"
Description
This rule flags constant fields that are not declared as "final".
Fields that are initialized in a declaration and values that do not change throughout the class should be "final" fields.
Example
package MISC;
public class FF {
private int size = 5; // violation
private void method () {
// do something but size's value do not change.
}
}
Repair
Declare 'size' "final".
|