热门

最新

红包

立Flag

投票

同城

我的

发布
qq_46027532
0117qq
5 年前
trueqq_46027532

public class ShowTest{

public static void main(String[] args) {

Singleton si = new Singleton();

si.printMessage();



}

}

class Singleton {

private static Singleton instance = new Singleton();

public static Singleton getInstance(){

return instance;

}

public String printMessage(){

return "我代表一个功能,已完成!";

}

private Singleton(){};

}

这个代码为啥是错的

保持热爱共赴山海
CSDN App 扫码分享
分享
评论
点赞
打赏
  • 复制链接
  • 举报
下一条:
leetCode打卡 Day 9
立即登录