# Final Keyword

&#x20;1\. Is a keyword.

&#x20;2\. The final keyword can be used in many contexts. final can be: Variable Method Class

&#x20;3\. If you want to declare constant variables where in the value cannot change, then those variables should be declared with the keyword “final”.&#x20;

4\. Final variable value cannot be changed or overridden.

&#x20;5\. Both local and global variable can be final.&#x20;

6\. Global final variable should be initialized at the time of initialization itself.&#x20;

7\. Local final variable can be declared once and initialized later.&#x20;

8\. In terms of inheritance, final keyword us used to avoid overriding.&#x20;

9\. Final class cannot be inherited.&#x20;

10\. Final class methods cannot be overridden because for method overriding inheritance is mandatory

![](https://106491783-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LTW0eWU2biq082hmKEn%2F-LTfb7irWOC4MFZaGMpe%2F-LTfbXofuStuYC6ANQAK%2Fimage.png?alt=media\&token=1e407c41-b550-4553-ab6d-08c034f16a33)

> &#x20;Note:  If you make a variable as final then we can never re-initialize that variable.  Static and non-static variable if made Final then its initialization is mandatory or else we will get blank field error.

![](https://106491783-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LTW0eWU2biq082hmKEn%2F-LTfb7irWOC4MFZaGMpe%2F-LTfbeKE5C4giy1RqLsr%2Fimage.png?alt=media\&token=76a71a38-b36a-4ed5-9ad4-b109d12dd2c5)

> &#x20;Note: In case of local variable make it final there is no error, but using it without initialization will throw error.

![](https://106491783-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LTW0eWU2biq082hmKEn%2F-LTfb7irWOC4MFZaGMpe%2F-LTfbp5HUfWuBnyN5R5f%2Fimage.png?alt=media\&token=45779103-5055-4286-963d-c0b88f5353d1)

> &#x20;Note: If you make an array as final then its size cannot be altered.

> >
