Synopsis: | This final field could be made static |
Language: | Java |
Severity Level: | 4 |
Category: | Design |
Description: |
If a final field is assigned to a compile-time constant, it could be
made static, thus saving overhead in each object at runtime.public class Foo { public final int BAR = 42; // this could be static and save some space } |