import java.io.IOException;
// checked exception 인 IOexception을 사용하기 위해 import 했습니다.
public class sub1
{
public static void main( String args[] )
{
try
{
throw new IOException();
}
catch ( Exception exception ) // 아래 주석부분과 같이 IOException을 바로 불러와도 되지만,
{ // 수퍼클래스인 Exception을 이용하여 catch 하였음
exception.printStackTrace();
}
/* catch ( IOException ioException )
{
System.err.println( "IOException" );
}
*/ }
}
'IT' 카테고리의 다른 글
sub1.java (0) | 2014.05.17 |
---|---|
sub2.java (0) | 2014.05.17 |
sub2.java (0) | 2014.05.17 |
test3 .java (0) | 2014.05.17 |
ListFrame .java (0) | 2014.05.17 |