Why Static variable required in java?For ex,class A
{
static int a;
int b;
}
Why static is required?
Answer Posted / aswini
Without using instance of the class means no need to use the class object to call static variable insted directly use the classname to use the static variable.moreover ,only one copy of static varible avaible to use all the classes.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Explain an intermediate language?
Why char array is favored over string for the storage of passwords?
Why spring singleton is not thread safe?
Discuss 2D arrays.
which pattern is default in scanner package?
Why do we declare a class static?
Is alive in java?
What is the difference between size and length in java?
What is the purpose of the enableevents() method in java programming?
What do you mean by multithreaded program?
What is passing by reference in java?
Explain the features of interfaces in java?
Explain about strings in java?
How many digits is int32?
How to restrict a member of a class from inheriting by its sub classes?