You want to create a singleton class by using the Singleton design pattern.
Which two statements enforce the singleton nature of the design?
A.
Make the class static.
B.
Make the constructor private.
C.
Override equals() and hashCode() methods of the java.lang.Object class.
D.
Use a static reference to point to the single instance.
E.
Implement the Serializable interface.
B and D
B, D
Generaly, there are two ways to implement a Singleton:
1) With a private constructor and a static factory method
2) As an enum