Skip to content

[Chapter 03] IllegalArgumentException vs. IllegalStateException #13

Discussion options

You must be logged in to vote

@corock 님께서 예전에 정리해주신 글 참고하여 다시 한번 상기하게 되었네요

IllegalArgumentException

호출자가 인수로 부적절한 값을 넘길 때 던지는 예외

  • e.g. 반복 횟수를 지정하는 매개변수에 음수를 전달할 때

IllegalStateException

대상 객체의 상태가 호출된 메서드를 수행하기에 적합하지 않을 때 던지는 예외

  • e.g. 제대로 초기화되지 않은 객체를 사용하려 할 때

참고자료

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by corock
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chapter03 스프링 애플리케이션 기본
3 participants