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 maximum size of arraylist in java?
How do you declare an array in java?
How do I get a substring?
What is meant by collection in java?
What is method overloading in JAVA? Why is it not present in C ?
What kind of variables can a class consist?
What is the static keyword?
What is the meaning of immutable regarding string?
How does split work in java?
Is string is a keyword in java?
What does three dots mean in java?
How many decimal digits is 64 bit?
I want to control database connections in my program and want that only one thread should be able to make database connection at a time. How can I implement this logic?
How do you reverse a word in java?
What is multithreading and its advantages?