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


Please Help Members By Posting Answers For Below Questions

What is the final keyword?

549


What is nested loop? What is dangling else condition in it?

572


What is a heavyweight component?

542


What is procedure writing?

507


Is string is a data type?

568






What is a local class in java?

581


What is your platform’s default character encoding?

553


What is int argc char * argv?

562


What Is Composition?

575


What is meant by flickering?

652


How many bytes is a string java?

526


What is string length in java?

488


What does n mean?

517


How do you check if a character in a string is a digit or letter?

508


Is java a security risk?

561