티스토리 뷰
import java.io.*; public class _4_1 { public static void main(String[] args) throws Exception{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int su1 = 0; System.out.print("su1 = "); su1 = Integer.parseInt(in.readLine()); if(su1 > 100){ // 강제적으로 예외 발생 System.out.println("예외 발생 :"); Exception ex = new Exception(">100"); throw ex; } } }
'dev > java' 카테고리의 다른 글
[16] Text(2바이트) 기반 출력 (0) | 2008.09.29 |
---|---|
[15] 예외처리 : try - catch - finally (0) | 2008.09.29 |
[15] Thread의 동기화(synchronize) 문제 (0) | 2008.09.29 |
[15] Thread 이용해서 시간출력.. ㅎㅎ (0) | 2008.09.29 |
[15] Thread 관련 이것저것 (0) | 2008.09.27 |
공지사항