mardi 30 août 2016

Singleton Class or Class with only static fields? [duplicate]

This question already has an answer here:

what is the better approach?

Let us assume a scenario in which there is a utility class that is used by other classes. What is better to use in this case, a singleton class which can be instantiated exactly once or should i make all the fieds static?

Aucun commentaire:

Enregistrer un commentaire