0
What is difference b/w a singelton class and a static class?
From what i know singelton class only have one instance and static class also can have only one object if all methods and variables are static. So, is there any particular diff b/w both?
2 Respuestas
+ 3
Singleton is a pattern and not a keyword. ... A Singleton can implement interfaces, inherit from other classes and allow inheritance. While a static class cannot inherit their instance members. So Singleton is more flexible than static classes and can maintain state.
0
Thanks for the explanation. ☺️☺️
can you please explain line singelton is pattern.