Eclipse中如何开启断言(Assert),方法有二

Eclipse中如何开启断言(Assert),方法有二:
1.Run -> Run Configurations -> Arguments页签 -> VM arguments文本框中加上断言开启的标志:-enableassertions 或者-ea 就可以了
2.在myEclipse中,Windows -> Preferences ->Java ->Installed JREs ->点击正使用的JDK ->Edit ->Default VM Arguments文本框中输入:-ea(本人采用了此方法)

原文地址:https://www.cnblogs.com/toSeeMyDream/p/6378856.html