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 instance variable 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 "instance variable" Watch "instance variable" New topic
Author

instance variable

Muhammad Usman
Greenhorn

Joined: Nov 18, 2001
Posts: 29
hi, friends
i like to know
" instance variables declared as Static are, essentially, global variables."
can u tell me what does it mean.

an student of Operation Badar ( a educational movement in Pakistan).
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi muhammad,
In C language, among others, you can define a global variable. That means that it could be used anywhere in the program without having to declare it in every method.
In java, a static variable can be used by any method in the class. It can be thought of as a global class variable. Instead of creating many local variables and passing them around as method parameters, a static class variable can be used instead.
Regards,
Manfred.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: instance variable
 
Similar Threads
Youtube embed
Garbase Collection
Static Blocks
Variables in Java
static block