Which access specifier should be used in a class where the instances can’t be created?
A. Private default constructor
B. All private constructors
C. Only default constructor to be public
D. Only default constructor to be protected
Answer: b
Explanation: All the constructors must be made private. This will restrict the instance of class to be made anywhere in the program. Since the constructors are private, no instance will be able to call them and hence won’t be allocated with any memory space.