Like 'val' and 'var' in Scala.
Like 'const' and 'let' in JavaScript.
We know most of variables are immutable.
//I guarantee someone will emphasise
//"var should be replaced with val!"
//"let should be replaced with const!"
def test(a:Int):Int={ function(a){
var b = a let b = a
or
var c = 1 let c = 1
b + c return b + c
} }
but when I write it in Java
//someone will think it looks strange!
int test(final int a){
final int b = a;
final int c = 1;
return b + c;
}
What correct way on it?