Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is document root?

859


I’m new to WebLogic Does anyone knows how to Deploy Application using

2122


How do you compile java?

845


What is callback methods?

952


What is caller principal?

921


How many java languages are there?

896


How does javac compiler work?

810


Explain jta, jndi, and jms.

962


What is the J2EE module?

973


What is difference between javac and java?

943


What does application client module contain?

941


Why is java robust?

1160


What is java ee used for?

782


What is distributed application?

892


Which of the following are subclasses of java awt component?

876