Why Static variable required in java?For ex,class A
{
static int a;
int b;
}
Why static is required?
Answer Posted / sumit pal singh
static keyword is mainly used for memory management purpose. And static variable is used for declare the common property of object.
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is a method vs function?
Which data type is class in java?
Explain the difference between hashmap and hashtable in java?
What is the use of accept () method in java?
What is the difference between path and classpath variables?
Difference between collection, collection and collections in java?
How to write custom exception in java?
Explain 5 io best practices?
Detail discussions on JVM, memory management and garbage collector.
Explain wrapper classes in java?
What is nested class?
How do you achieve singleton?
What is the point of polymorphism java?
What does yield method of the thread class do?
describe method overloading