Lesson 30 of 34
static, final
8 min 35 XP
static field എല്ലാ objects-നും പൊതുവാണ്, അതിന് ഒരു copy മാത്രം, ഉദാഹരണത്തിന് എത്ര objects ഉണ്ടാക്കി എന്ന് എണ്ണാൻ. static method object ഇല്ലാതെ ClassName.method() എന്ന് call ചെയ്യൂ. final value മാറ്റാനാവില്ല.
Example: edit me and press Run
Output Loading Java (first time takes a few seconds)
Press Run to see the result here.main() എന്തുകൊണ്ട് static? ഒരു object-ഉം ഉണ്ടാകുന്നതിന് മുമ്പ് JVM അതിനെ call ചെയ്യണം. ജനപ്രിയ interview ചോദ്യം.