Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 국제화
- Graphic
- 안드로이드
- Menu
- mybatis
- Java
- OGNL
- JavaScript
- struts2
- Android
- oracle
- AWT
- paint
- 오버로딩
- 예외처리
- 이클립스
- JSP
- 클래스
- 메서드
- Eclips
- 전화걸기
- 에러페이지
- 메소드
- layout
- 기본
- 생성자
- 어노테이션
- HTML
- 배열
- Spring
Archives
- Today
- Total
목록throw (1)
note
예외처리 throw사용법
package com.basic;//예외처리 throw 사용법(예외를 강제적으로) public class ThrowEx1 { public void methodA(String[] n)throws Exception{ if(n.length>0){ //개선된 루프 (jdk5.0이상에서만 사용가능) //n은 인덱스 주소값을 모두 출력해서 s에 저장(?) for(String s : n) System.out.println(s); }else throw new Exception("배열에 요소가 없습니다1."); } public static void main(String[] args){ ThrowEx1 te = new ThrowEx1(); try{ te.methodA(args); }catch(Exception e){//1..
자바/예외처리
2011. 12. 27. 10:38