wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Static Varaibles Explination Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Static Varaibles Explination" Watch "Static Varaibles Explination" New topic

Static Varaibles Explination

Osgar ali

Joined: Jan 24, 2009
Posts: 22

I know what static variable, When it comes to it application can someone explain me the circumstances where I can use static variables.
and circumstances where I don't want to use static variables. Any Example will really help.

Dean Pullen
Ranch Hand

Joined: May 30, 2003
Posts: 58
Tbh it's pretty easy to find information on static usage on the web, via Google.

And the Sun Java tutorial: http://java.sun.com/docs/books/tutorial/java/javaOO/classvars.html

Static members are class members, not class instance members.
So there's one 'instance' of each static member for any number of class instances.

I think that tutorial page above does a pretty good job of explaining it, and even has a very basic example.
Osgar ali

Joined: Jan 24, 2009
Posts: 22
I agree. Here's the link: http://aspose.com/file-tools
subject: Static Varaibles Explination