반응형
예외처리 기본 예제
public class ExceptionTest {
public static void main(String[] args) {
try{
int i = Integer.parseInt(args[0]);
int j = Integer.parseInt(args[1]);
System.out.println(i/j);
}
catch (ArithmeticException e) {
e.printStackTrace();
System.out.println("0을 입력하지 마시오");
}
System.out.println("완료");
}
}
반응형
'콩's EDUCATION > 콩's JAVA_RUN' 카테고리의 다른 글
throws 처리 (0) | 2014.05.16 |
---|---|
finally 처리 (0) | 2014.05.16 |
Java 문제 4 (0) | 2014.05.15 |
인터페이스(interface) (0) | 2014.05.15 |
추상(abstarct) 메소드 (0) | 2014.05.15 |