DEV Community

Discussion on: Effective Java Tuesday! Singletons!

Collapse
 
jboschmans profile image
jboschmans

Thank you for your response. I guess I didn't explain very well. What I mean is a class where the members and methods are static. This way you can call the static method of the class to do what you want instead of creating an object. eg: ClassName.staticMethod()

Thread Thread
 
kylec32 profile image
Kyle Carter

Thanks for that clarification. Yeah I don't see any problem with that. It seems like just a slight change from option 1. Potentially the downside I see is you don't keep the option of changing how it gets initialized in the future. If that's not needed then you likely are good with this option.

Thread Thread
 
jboschmans profile image
jboschmans

Thank you for your answer!