What is static variable and static method?
Answer Posted / ahmad
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 ? | 0 Yes | 0 No |
Post New Answer View All Answers
Can a main method be declared final?
What is a file pointer?
Define inheritance with reference to java.
What does opcode mean?
What are the differences between checked exception and unchecked exception?
State two differences between C and Java.
What is the use of static class?
What is object cloning in Java?
Can java arraylist hold different types?
What is appletviewer?
Difference between arraylist and hashset in java?
What is a return in java?
When a lot of changes are required in data, which one should be a preference to be used? String or stringbuffer?
What is a byte string?
Will minecraft java be discontinued?