class Sample{
private static mySample = null;
private Sample(){
you init
}
public static Sample getInstance(){
if( this.mySample == null ){
this.mySample = new Sample();
}
ruturn this.mySample;
}
}class anotherclass{
Sample hehe = Sample.getInstance();
}
private static mySample = null;
private Sample(){
you init
}
public static Sample getInstance(){
if( this.mySample == null ){
this.mySample = new Sample();
}
ruturn this.mySample;
}
}class anotherclass{
Sample hehe = Sample.getInstance();
}
private static mySample = null;
private Sample(){
you init
}
public static Sample getInstance(){
if( this.mySample == null ){
this.mySample = new Sample();
}
ruturn this.mySample;
}
}class yourserverlet{
Sample hehe = Sample.getInstance();
}