final variable - what is it ?
Preetika Prakash
1 min read
Final variables are written in capital letters as per the standards.
Final variables cannot be modified.
Final variables don’t have any default value, without initializing and printing it will give an error.
When used Inside the Method, final Variables can be written without initialization and can also be initialized later.
Whereas, when used Inside as Class Member, final Variables cannot be written without initialization plus they can’t get initialized later.
0
Subscribe to my newsletter
Read articles from Preetika Prakash directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Preetika Prakash
Preetika Prakash
Attempting #100DaysofCode challenge | Open Source Contributor