Why Static variable required in java?For ex,class A
{
static int a;
int b;
}
Why static is required?
Answer Posted / vaishnavi
To answer Soumya's question, instance variables are declared at class level, but the instance variables still belong to an instance/object. But static variables belong to a class.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Define Multiprogramming and Multiprocessing in java.
What design pattern you have used in your project? I answered Factory pattern, how it is implemented? What are its advantage? Do know about Abstract Factory?
What is the current version of java?
Is null == null in java?
What are the three types of design patterns?
What is difference between an object and a class?
Can a lock be acquired on a class in java programming?
Why collection doesn’t extend cloneable and serializable interfaces?
I don’t want my class to be inherited by any other class. What should I do?
What is the difference between an array and an array list?
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?
Which types of exceptions are caught at compile time?
What are the differences between string, stringbuffer and stringbuilder?
What is lexicographically smallest string?
What is arrays aslist in java?