• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

instance variable

 
Muhammad Usman
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, friends
i like to know
" instance variables declared as Static are, essentially, global variables."
can u tell me what does it mean.
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic