package ch11.exception;
public class Test {
public void apple() throws Exception{
RuntimeException ex=new RuntimeException("Test apple()");
throw ex;
}
public void banana() throws Exception{
System.out.println("Test banana()");
apple();
}
}
package ch11.exception;
public class Ex06 {
public static void main(String[] args) {
Test test=new Test();
test.banana(); //ERORR발생 예외처리(try-catch) 해주어야함
}
}
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Unhandled exception type Exception
at ch11.exception.Ex06.main(Ex06.java:6)