Maybe my question will be so much silly for 2016 because there exist many similar questions but it is very hard to me to understand when should i use final variable inside a method instead of local variable. Which one will be more efficiency and when should i use it.
public void setmethod(int var)
{
final int variable = var;
System.out.println(variable);
}
public void setmethod(int var)
{
int variable = var;
System.out.println(variable);
}
I know that The result in the Output will be the same and also that Final fields - is making that same fields reference immutable but which one option is more efficiency under certain circumstances and Why?? I am a bit confused