Final and static | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 5

Final and static

what is the difference between final and static keyword?

10th Dec 2017, 6:31 AM
Sahil Jain
Sahil Jain - avatar
2 Respostas
+ 9
Once it has been assigned, the value of theĀ finalĀ variable cannot change.Ā staticmeans it belongs to the class not an instance, this means that there is only one copy of that variable/method sharedĀ betweenĀ all instances of a particular Class. ... This is where thestatic keywordĀ comes in https://stackoverflow.com/questions/13772827/difference-between-static-and-final
10th Dec 2017, 6:38 AM
GAWEN STEASY
GAWEN STEASY - avatar
+ 2
thanks...
10th Dec 2017, 6:41 AM
Sahil Jain
Sahil Jain - avatar