예외(Exception)란?
예외(Exception)
Exception VS Error
예외처리
예시
예외 처리 방법
try catch finally
throws
import java.io.IOException;
// throws
public class ThrowsTest {
public static void main(String[] args) throws IOException {
byte[] byteArr = {'a', 'b', 'c'}; // 숫자로 변환되어 배열에 저장됨
System.out.write(byteArr);
}
}
Java
복사
System.out.write() 란?
예외 클래스 구분
예외의 종류
•
체크 예외(checked exception)
•
실행 예외(runtime exception) 또는 언체크 예외 (unchecked exception)
체크 예외
언체크 예외
예외 처리를 프로그래머가 해야 하는 경우
예시


