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: 报名.类名
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: 报名.类名