See this sample code--
Class A{
private A(){
}
public static A CreateObject(){
return new A();
}
}
Class B{
public static void main(String arg[]){
A a=A.CreateObject();
}
}
Hope u would get it. Well why do u need this actully this is used for
singletone pater n the code whc i hav given here is not exactly
singleton of pattern. (I can do tht also).