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 ಪ್ರಶ್ನೆ.