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


Please Help Members By Posting Answers For Below Questions

What is the difference between replace and replace all?

464


how to deploy apache tomcat server to weblogic server in java

1591


What are the benefits of operations?

508


What is a method in java?

553


what is heap memory?

652






what is encapsulation in java? Explain

657


How to perform bubble sort in java?

584


What do you mean by chromounits in java8?

524


what is the swingutilities.invokelater(runnable) method for? : Java thread

539


Is java an open source?

518


What is binary search in java?

553


Justify your answer that you can't define a method inside another method in java, if you can then how?

600


What is connection class in java?

503


What 5 doubled?

504


Explain importance of inheritance in java?

599