can anybody explain me clearly on java singleton design pattern class vs java final class. can we use final class instead of using singleton class, for final class we can create the instance of the class and use the methods in that but not overriding properties, if that methods are static in final class we can just call the methods like ClassName.getMethod, why we go for singleton instead of final class.
Aucun commentaire:
Enregistrer un commentaire