[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index] [Home]

Re: global.jsa


> this is not a complete singleton implementation. In java we live
> in a multithreaded world !
> 
> class MyObject
> {
>         static MyObject instance = null;
>         public static MyObject getInstance()
>         {
> 		synchronized( MyObject.class)
>  		{
>                   if(instance==null)
>                         instance = new MyObject();
> 		}
>                 return instance;
>         }
> }
> 
> I hope this help in obscure situations! 

 You are totally right...

 Thank you very much!!