Un exemple de singleton final:
/*
* Created on 10-nov.-2005
* Author: HackTrack
*/
public final class SingletonDemo {
private static SingletonDemo instance;
private SingletonDemo() {
super();
}
public static SingletonDemo getInstance(){
if(instance==null)
instance=new SingletonDemo();
return instance;
}
}
;-)
HackTrack

