0
Benefit from the final
Very dubious use of finals in class discriptions
3 ответов
0
If your intention is to ask what is final keyword in java.
Final is used to define constant.
If you want any variable to be constant through your execution then you can use final.
It's value can never be changed.
Declaration:
Final x =0;
Final PI = 3.14;
Etc
And in final class you can't inherit final class.
See, like if you want your class not be inherit for defining something in your class like variable which are need to be used in one class only. etc
0
Declaring constant variables final will save resources.
If you don't mark a variable, that is not supposed to be changed, to final, program will waste resources just for being ready to change the variable state.