1.java默認(rèn)是不開啟斷言的
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: 報(bào)名.類名
1.java默認(rèn)是不開啟斷言的
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: 報(bào)名.類名