What is static variable and static method?
Answer Posted / anupam sharma
static variables are classes variables not instance
variables .They are hold the value and instantianted only
once for a
class.They are initialised at class load time.
Static method can be referenced with the name of the name
of the particular object of that class. That's how the
library methods like System.out.println works.
| Is This Answer Correct ? | 16 Yes | 18 No |
Post New Answer View All Answers
What is the purpose of encapsulation?
Why are the objects immutable in java?
How static variable work in java?
What is wrapper class html?
What is this keyword used for?
What is meant by main method?
What is a null check?
What is a subsequence of a string?
How does hashset works in java?
Can we use a default constructor of a class even if an explicit constructor is defined?
Can you call one constructor from another if a class has multiple constructors?
When do we use synchronized methods in java?
What is a finally block? Is there a case when finally will not execute?
What is java used for?
What happens if a try-catch-finally statement does not have a catch clause to handle an exception that is thrown within the body of the try statement?