public class Tester { static void method() throws Exception { throw new Exception(); } public static void main(String[] args) { try { method(); } catch (Throwable e) { try { throw new Exception() ; } catch (Exception ex) { System.out.print("exception"); } finally { System.out.print("finally"); } } } }
static void method() throws Exception {
throw new Exception();
}
public static void main(String[] args) {
try {
method();
} catch (Throwable e) {
throw new Exception() ;
} catch (Exception ex) {
System.out.print("exception");
} finally {
System.out.print("finally");
Oracle Certified Professional Java Programmer
Access: Public Instant Grading
Jobilize.com uses cookies to ensure that you get the best experience. By continuing to use Jobilize.com web-site, you agree to the Terms of Use.