TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
TIOBE - Java Coding Standard
Search

Rule:  Optimization1Checked automatically with code checker

Synopsis:Local variables assigned only once can be declared final
Language:Java
Severity Level:4
Category:Optimization


Description:
A local variable assigned only once can be declared final.
public class Bar {
 public void foo () {
  String a = "a"; //if a will not be assigned again it is better to do this:
  final String b = "b";
 }
}