私有构造器不可实例化类模板

1
2
3
4
5
6
public class UtilityClass {
    // Suppress default constructor for noninstantiability
    private UtilityClass() {
        throw new AssertionError();
    }
}

 

posted on   力奋  阅读(235)  评论(0编辑  收藏  举报
努力加载评论中...

点击右上角即可分享
微信分享提示