Thursday, April 9, 2020

Why do we have to make the GetInstance() method or Instance Property of a Singleton class Static?

Because the constructor of the singleton class is private and can't be accessed from the outside world. Therefore there is no other way for us to access the methods of this class than making it static.


No comments:

Post a Comment