摘要:
要使assert起作用,要有-ea选项,对eclipse,可以这样设置http://www.vogella.com/blog/2009/02/06/enabling-java-assertions-per-default-in-eclipse-runtime-configuration/一个简单测试public class TestAssert { public static void main(String[] args) { assert false; System.out.println("test"); }}输出:Exception in thr... 阅读全文