static variable is a class variable which value remains
constant for the entire class?? variable means value is
changed....hear value is not changed... why it is called
static variable

Answers were Sorted based on User's Feedback



static variable is a class variable which value remains constant for the entire class?? variable me..

Answer / hasan

We can change the value of Static variable but if we change it reflect the main static variable
static variable is variable which is common to all object it memory is allot once and share by all object if any change then it is reflect the main value

who sad Static viable value not change it change.........

Is This Answer Correct ?    21 Yes 1 No

static variable is a class variable which value remains constant for the entire class?? variable me..

Answer / kavita

Only variables marked as final cannot be changed.
Static variables memory is alloted once and shared by all the objects

Is This Answer Correct ?    9 Yes 0 No

static variable is a class variable which value remains constant for the entire class?? variable me..

Answer / singh_prabhakar

its a misconception if u think tht static variable's values
are nt changed....it does....!!!
the keyword static only means tht this variable belongs to
the class ie every object tht uses this var is using the
only copy of it wch lies with the class......unlike the
instance variable where when accessed every object enjoys a
copy for itself...
in short --in a class thr's a - "static int k=0;" n class
has three objects -"ob1,ob2,ob3" n say all tends to
increment "+2" to the value of k...then @ end after being
accessed by aal three objects the final value of "k" wud be
"6" ..!!!
[ASSUME it like a JOINT ACCOUNT IN A BANK BETWEEN TWO
SIBLINGS...transactions made by any of them is Reflected in
the shared account..]

Is This Answer Correct ?    4 Yes 0 No

static variable is a class variable which value remains constant for the entire class?? variable me..

Answer / a anand

A variable which is declared with 'static' keyword called
"static variable" or "class variable". Because,when we
execute the java application JVM first search for the class
and it loads into the JVM's memory.Now, it open the class
and searches for static variables if JVM finds the static
variable in the class then JVM will allot memory for the
static variables in HEAP area.Memory for the static
variables will be allotted only once at the time of loading
the class, that means static variable is only one per the
class.Hence, we call static variable as class variable.

Is This Answer Correct ?    13 Yes 12 No

static variable is a class variable which value remains constant for the entire class?? variable me..

Answer / narayana

because static means class variable ,
it loads the when class variable

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More J2EE Interview Questions

What is the latest framework in java?

0 Answers  


What is distributed application?

0 Answers  


Why do we use j2ee?

0 Answers  


What are the components of J2EE application?

0 Answers  


What is layout in java?

0 Answers  






what is jvm? how can it is useful in java?

3 Answers  


What is caller principal?

0 Answers  


What is enterprise information system resource?

0 Answers  


What is isv?

0 Answers  


What is basic authentication?

0 Answers  


What is setfocusable in java?

0 Answers  


What is event and listener in java?

0 Answers  


Categories