• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

static vs. global

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a general question.
Does creating static items have the same stigmatism as creating global items?
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If by stigmatism you mean are static variables "all over the place," the answer is yes, but not in the same way.
A gloabal variable in C, for example, is a universal identifier, such as the defined value TRUE. You have something similar in Java, but because no identifier exists without a class definition, the namespace is by definition already segmented. TRUE for one class can be completely different from a TRUE in another class, and they'll be separated by their class names, e.g., This.TRUE and That.TRUE.
------------------
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic