Can we replace singleton design pattern by making all the methods of the class as static and declaring all the constructors as private. This way other classes won't be able to instantiate this class and have to invoke methods using class name only. Also which approach will be better performance wise?
Prakash Dwivedi (SCJP2, SCWCD, SCBCD)
"Failure is not when you fall down, Its only when you don't get up again"
Can we replace singleton design pattern by making all the methods of the class as static and declaring all the constructors as private.
Yes you replace singleton by making all methods static. I don't see any performance gain using static methods. I am more comfortable using singleton rather than all-methods-static class implementation even though there is no harm using the latter.