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
What checkbox method allows you to tell if a checkbox is checked?
What is java in layman terms?
What are static blocks and static initalizers in java ?
What is ternary operator?
Can we use return in constructor?
What is the definition of tree ?
Which is better list or arraylist in java?
What is the meaning of course?
Explain reverse a linked list iterative solution in java?
How we can skip finally block of exception even if some exception occurs in the exception block in java?
whar are the draw backs of programming lang step by step in Clang and next in C++ and next and in Java nad in .Net
State two differences between C and Java.
What is the covariant return type?
What restrictions are placed on method overriding?
Why do we need singleton?