Hi,
What is advantage of declaring 'final' in the input parameter of a function?
public void myFunction(final Sting str);
The only thing I can't do is this inside the function:
str = new
String();
But even if i do that, the 'str' passed in by the caller won't change.
So I don't see what is the advantage of doing this.
However, in C++, if the input reference is 'const', I can only call the public const method of that class. I don't think
Java behaves like this: