断言

2019-05-12  本文已影响0人  八颗小牙坏脾气

1.java默认是不开启断言的

 public static void main(String[] args) {
        int x = 5;
        assert  x > 10 : "x should max than 10";
        System.out.println("result");
    }

2.开启
Idea VM options: -ea: 报名.类名

上一篇 下一篇

猜你喜欢

热点阅读