wood burning stoves
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes static variable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "static variable" Watch "static variable" New topic

static variable

sudha siva
Ranch Hand

Joined: Sep 18, 2001
Posts: 30
why local variables should not be static?
Fei Ng
Ranch Hand

Joined: Aug 26, 2000
Posts: 1242
well.. local var is local var. It will be gone when the method
Static var...
Any attribute that has the static modifier applies to the entire class as a whole. Its like a global var. You can use it globally.
hope this help.

Don't get me started about those stupid light bulbs.
subject: static variable
It's not a secret anymore!