Question d’entretien chez Cognizant

Q. What is the difference between Singleton and Immutable object

Réponses aux questions d'entretien

Utilisateur anonyme

20 mai 2021

Immutable class also doesn't mean you cannot create more objects of the same immutable class. For singleton, usually one instance per JVM is necessary for it to be called singleton.

Utilisateur anonyme

22 déc. 2015

Singleton object will have only one object and multiple states and Immutable object will have each new object with each time the state is changed

3