Question d’entretien chez Dynakode

What is singleton class in Java and how can we make a class singleton?

Réponse à la question d'entretien

Utilisateur anonyme

21 mars 2021

Singleton class is a class whose only one instance can be created at any given time, in one JVM. A class can be made singleton by making its constructor private.