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 are the two types of java programming?

533


What is loop in java?

525


How many times finalize method will be invoked? Who invokes finalize() method in java?

572


What are peerless components?

616


What are locale settings?

550






What is the difference between compiler and jvm?

551


Can you override static methods?

502


Explain about join() method?

543


what is synchronization and why is it important? : Java thread

584


What is a local class in java?

581


Can I declare a class as private?

586


What is byte [] in java?

530


What is difference between adapter class and listener?

495


What is an 8 bit word?

590


What is a lock or purpose of locks in java?

589