Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
    Bookmark Topic Watch Topic
  • New Topic

Static Objects  RSS feed

 
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.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!