Why do we make a copy of final instance variable in a method in Java?
- by PRK
For instance:
private final Object o;
public void doSomething(){
final Object local = this.o;
//access methods of local;
}
This practice is followed in lots of java classes (such as ArrayBlockingQueue). What's the benefit of this?