Programming/Java

java assert

구차니 2014. 3. 20. 13:40
c에서의 assert 문 처럼
특정 조건에 대해서 참/거짓 시에 강제로 종료하는 역활을 한다.

[링크 : http://docs.oracle.com/javase/7/docs/technotes/guides/language/assert.html]

assert는 디버깅 용도이기 때문에
assertion mode가 꺼져있어
-ea 옵션(Enable Assertion)을 통해 디버깅 모드로 작동하도록 설정해야 한다.


[링크 : http://javacan.tistory.com/70]
[링크 : http://stackoverflow.com/questions/5509082/eclipse-enable-assertions]