2
Answers

Force subclass to implement private constructor

Dennis Trier

Dennis Trier

6y
914
1
Hi All
 
I'm working on a school-project, and have made an abstract generic class to implement a singleton designpattern on my managerclasses.
 
However, when I give the GetInstance method it would be nice to force the subclass to hide it's constructor, as it should not be used.
 
How can I, in my superclass, force my subclass to implement the constructor as private?
 
Thanks! :-)
 
 
Answers (2)