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
Explain access modifiers in java.
What is class??
How to access arraylist elements in java?
What do heavy weight components mean in java programming?
What does || mean in vectors?
What is boolean strategy?
What types of index data structures can you have in java?
How do you reverse a word in java?
What do you understand by java?
What does this () mean in java?
What is a substring of a string?
Why Java is not pure Object Oriented language?
What are the major advantages of internal iteration over external iteration?
Is boolean a data type in java?
What is the default execution method in java?