Java runtime exception


[ 다음 글들 ] [ 이어서 글올리기(답하기) ] [ 자바 묻고 답하기 ]

글쓴이 :Sung Yi 2000년 2월 08일 06:02:24

In Reply to: [질문]run-time 시에 예외처리하는 방법있나요? posted by 박재형 on 2000년 2월 07일 17:29:26:

I think that you are doing just fine. That is the right way to catch a runtime error. The only program that I see is in the catch block declaration.


It should be
catch(IndexOutOfBoundException yourOwnVar){
}

Or, if you prefer, you can check the strings before processing.


if((temp1=str.indexOf("test")) >= 0 && (temp2=str.indexOf("program")) >= 0){
temp = str.substring(temp1, temp2);


If you wish to continue processing no matter what the outcome is, you can use the finally{} block.



다음 글들:



이어서 글올리기(답하기)

이름:
E-Mail:
제목:
내용:
HTML 태그 포함 여부: HTML 문서일 경우 체크
관련 URL(선택):
URL 제목(선택):
관련 이미지 URL:


[ 다음 글들 ] [ 이어서 글올리기(답하기) ] [ 자바 묻고 답하기 ]