This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
    Bookmark Topic Watch Topic
  • New Topic

Static Objects

 
Joseph Cho
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Report post to moderator
What is the best way to go about making a static class?

I know in C# you just declare the class static.. but In Java you cannot unless it's a subclass correct?

Also, if I declare a static reference to a class. I'm trying to wrap my head around this.. Does this mean whatever object the reference is pointed to, no matter what outside class makes an instance of the class holding the static object of another class.. it will always retain the same variables for that static class instance?
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
Duplicate. Locking.
 
    Bookmark Topic Watch Topic
  • New Topic