This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Static Varaibles Explination" Watch "Static Varaibles Explination" New topic
Author

Static Varaibles Explination

Osgar ali
Greenhorn

Joined: Jan 24, 2009
Posts: 22
Hi,

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.

Regads,
Oskar
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
Greenhorn

Joined: Jan 24, 2009
Posts: 22
Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Static Varaibles Explination
 
Similar Threads
Static methods
private static variables
enum and collection
Inheritance | Static variable
static variables