Microsoft
Software
Hardware
Network
Question : Java multi thread singleton
This questions is for my own future referece, please feel to comment.
Some experts suggests following thread safe singleton pattern.
public class Test {
public static getInstance(){
return SingleTest.test ;
}
private static class SingleTest{
public static Test test = new Test() ;
}
}
I have even simpler:
public class Test{
private static Test instance = new Test();
public static Test getInstance(){
return instance;
}
}
Am I right?
Answer : Java multi thread singleton
the only diff is that the later doesn't do lazy loading!
Random Solutions
Help with Lucene query in Alfresco
Batch File: Remove spaces in variable
Calling IE to run on second monitor in batch file log in script
changing external server name.. do I need to change anything in Outlook
Schedule Task "Could not start"
Is exercising in an air conditionedroom a good idea?
I want to make Liberty reserve API
RPC through HTTP keeps prompting for pw on Exchange 2010
Remove space from textbox automatically
SAP Requisition Total Amount