類是可以沒有public構造函數的,這樣可以防止其他的程序直接
創建該類的對象,可以應用在單例模式中:class test{
private static test f=new test();
public static test gettest(){
return f;
}
private test(){
}
}
創建該類的對象,可以應用在單例模式中:class test{
private static test f=new test();
public static test gettest(){
return f;
}
private test(){
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货