I want to force a singleton pattern implementation for any of the extended classes of my parent class. That is, I only need one instance of each child class (accessible via Child.INSTANCE or something like this).
Ideally, what I would like to do for a Child.INSTANCE object, and then there will be no other object of type Parent.
I am currently getting my instances through something like:
public class Child extends Parent { public static final Child INSTANCE = new Child(); ....
I wonder if the java class can become static or something in some way?
Thanks =]
source share