Engineering Full Stack Apps with Java and JavaScript
What will be the output of the following program?
class TestClass{ public static void main(String[] args) throws Exception{ try{ amethod(); System.out.println("try"); } catch(Exception e){ System.out.println("catch"); } finally { System.out.println("finally"); } System.out.println("out"); } public static void amethod(){ } }
Select 1 option
A. try finally
B. try finally out
C. try out
D. catch finally out
E. It will not compile because amethod() does not throw any exception.