Java 6일차 Throws 테스트

public class ThrowsTest
{
public void a() throws Exception
{
System.out.println("2");
try
{
b();
}
catch(Exception e)
{
System.out.println("5");
}

int result = 1/0;

System.out.println("6");
}

public void b() throws Exception
{
System.out.println("3");

int result = Integer.parseInt("b()");

System.out.println("4");
}

public static void main(String args[])
{
ThrowsTest tt = new ThrowsTest();

System.out.println("1");

try
{
tt.a();
}
catch(Exception e)
{
//e.printStackTrace();
}
}
}

댓글 없음: