Final keyword in Java instructions

1, with the final to modify data

Modification of data can not be changed

2, final modification is the object

You can not change the reference to the object, but you can modify an object's property values

3, with the final to modify parameters

Modification of data can not be changed

4, with a final time to modify process (function)

Locking means of preventing extends it to modify the (coverage) which

to sum up:

With final modifications, mainly to show "non-modifiable nature", thereby improving safety.

Published 24 original articles · won praise 0 · Views 437

Guess you like

Origin blog.csdn.net/WillliveWillWork/article/details/101365970