writes:
>>public void setName( final java.lang.String name )
>it is quite rare to see people to use the "final" keyword, what is the
>exact advantage of doing so?
It is intended to be somewhat similar to the in in Ada:
procedure Average(A, B : in Integer; Result : out Integer);
(That was Ada, not Java.)
It expresses my intention only to read from the parameter and
not to change the binding of the name name - though, of
course, the semantics of the final in Java are not the same
as those of in in Ada or const in C.
If I would inadvertently change the in-Parameter, the compiler
could issue a warning. But it also helps human readers to
grasp my intention never to change the binding of the
name name within this method declaration.