What is meant by static variable and static method ?

What is meant by static variable and static method ?

Static variable is also known as class variable, global variable.

The static variable is used to refer the common property of all objects,variables that are common to all objects.Static is a modifier used with class, methods and blocks.

 Static member never associated with object but with class.Static members are loaded when class is loaded into jvm, hence static members are accessed without()before) creating an object itself.

 A static method cannot access instance variable, instance methods and cannot use this or super from static context.


By:Sumit Tripathi
Date:2020-05-15 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related Java Subjective Links

Java Subjective interview questions and answers for experienced and fresher