日期:2014-05-20  浏览次数:20634 次

java中构造可以私有吗
希望能够详细说
说得分展些

------解决方案--------------------
当然可以,一般用于构造单例:
public class Test{
public static Test instanse;

private Test(){}
public synchronized static getInstanse(){
if(null == instanse) instanse = new Test();
return instanse;
}
}