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
Why enumeration is faster than iterator?
how come we know the object is no more used in the class?
What are the types of exceptions?
Explain the concept of hashtables?
Write the algorithm to check the number non-leaf nodes in a tree.
What is a super method?
Why do we use regex?
What is constructor and virtual function? Can we call a virtual function in a constructor?
What is better- service oriented or batch oriented solutions?
What are the library functions in java?
What is difference between protected and private?
List out five keywords related to exception handling ?
What are the two types of streams offered by java 8?
What is the use of static class?
What is threaded programming and when is it used? : Java thread