public class Person {
// Person 引用
private static Person p = null;
static {
if (p == null) {
p = new Person();
}
}
/**
*单例模式获取Person对象.
* @return
*/
public static Person getInstance(){
return p;
}
}










网友评论