I would like to force some of my classes to be implemented in Singleton, but I came across the following situation.
interface ICharacterSingleton{
static Characters getInstancia();
}
public static class Zero extends Characters implements ICharacterSingleton {
private static Characters Instancia = null;
private Zero(){
Layout.add(" 111 ");
Layout.add(" 1 1 ");
Layout.add(" 1 1 ");
Layout.add(" 1 1 ");
Layout.add(" 1 1 ");
Layout.add(" 1 1 ");
Layout.add(" 1 1 ");
Layout.add(" 111 ");
}
public static Characters getInstancia() {
if(Instancia == null)
Instancia = new Zero();
return Instancia;
}
}
Can not I define a static method for an interface? is there another way out?