Multiple Choice Question

Quiz Guidelines

 

QID: 
526
Question: 

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.

Q&A Set: 

Search the Web

Custom Search

Searches whole web. Use the search in the right sidebar to search only within javajee.com!!!