반응형
class ThrowableTest {
public static void main(String[] args) {
try {
main(null);
} catch (Exception e) {
System.out.println("Exception");
} catch (StackOverflowError soe) {
System.out.println("StackOverflowError");
} catch (Error err) {
System.out.println("Error");
} catch (Throwable t) {
System.out.println("Throwable");
}
}
}
public static void main(String[] args) {
try {
main(null);
} catch (Exception e) {
System.out.println("Exception");
} catch (StackOverflowError soe) {
System.out.println("StackOverflowError");
} catch (Error err) {
System.out.println("Error");
} catch (Throwable t) {
System.out.println("Throwable");
}
}
}