What is static variable and static method?
Answer Posted / abnish kumar rajput
Static variables are those variables that are declared with
static keyword of java.Static variables are declared once
into a class and are available entire class.Static variables
are common to all objects of class.Static variables can be
accessed by non-static methods.Whereas Static methods are
those which are declared with static keyword and can only be
accessed static variables.If we have Static method then we
can call it directly with class_name.And static variables
and methods both are related to class,whereas non-static
variables and methods are related to object.
| Is This Answer Correct ? | 28 Yes | 17 No |
Post New Answer View All Answers
Can we override the private methods?
What are the default and parameterized constructors?
What is primitive data type in java?
What is anagram word?
Is map ordered in java?
How do you identify if jvm is 32-bit or 64-bit from java program?
How many bytes is a unicode character?
What are the different types of constructor?
How do you download stubs from Remote place?
What is a copy constructor in java?
List two java ide’s?
Is linked list a linear or non-linear data structure?
How do you declare a variable?
What is complexity and its types?
What is difference between word and integer?