The java final keyword can be used for:
- variables
- methods
- classes
The final modifier is used to not overwrite the variable. Normally if you write a program like this:
In this case, do I overwrite my variable i, with type int. Because first do I initialize/set the value on 5 and then in the void start() method do I overwrite the variable i with the value 10. So the output of the method will be 10.