I want to force implementation of the singleton pattern on any of the extended classes of my parent class. That is, I only want one instance of every child class to ever be around (accessible through Child.INSTANCE or something like this).
Ideally what I would like would be for the Child.INSTANCE object to be made, and then no other object of type Parent to be made.
Currently I get my instances through something like:
public class Child extends Parent {
public static final Child INSTANCE = new Child();
....
I wonder, can a java class be made static or something in some way?
Thanks =]