62,621
社区成员
发帖
与我相关
我的任务
分享
public class Test(){
private static final Test instance = new Test();
private Test(){
}
public Test getInstance(){
return instance;
}
}
public class Test(){
private static Test instance = null;
private Test(){
}
public Test getInstance(){
if (instance == null) {
synchronized (UserDao.class) {
if (instance == null) {
instance = new Test();
}
}
}
return instance;
}
}
public Class<?> loadClass(String name) throws ClassNotFoundException {
return loadClass(name, false);
}
protected synchronized Class<?> loadClass(String name, boolean resolve)
throws ClassNotFoundException
{....
}