Recently in the spring source depth analysis See the many methods of the parameters are modified by the final modifier what role is it not allowed to modify parameters in the method?
I checked the net.
Final type decorated parameters are divided into two types of basic types and reference types
Final decoration basic types are as follows
<span style= "White-space:pre" ></span>public void GetValue (final int a) { <span style= "White-space: Pre "></span>....<span style=" White-space:pre "></SPAN>}
If you modify the parameters of the above method in the method, you will get an error such as
Final Modified Reference type
public void GetValue (final Integer a) { ... }
If you modify the referenced object, you will also be prompted for the above error.
But in a different way
public void GetValue (final contract C) {c.hourspanname= "AA";}
There's no problem.
I have summed up the next 1, within the parameters of the call, whether it is a basic type or a reference type whose value is immutable (reference type refers to a reference object is not changed)
2. Variable attribute in reference type
3.
Effects of the final modification method passed in Java