Question
public class Test
{
public static void aMethod() throws Exception
{
try /* Line 5 */
{
throw new Exception(); /* Line 7 */
}
finally /* Line 9 */
{
System.out.print("finally "); /* Line 11 */
}
}
public static void main(String args[])
{
try
{
aMethod();
}
catch (Exception e) /* Line 20 */
{
System.out.print("exception ");
}
System.out.print("finished"); /* Line 24 */
}
}
a.
finally
b.
exception finished
c.
finally exception finished
d.
Compilation fails
Posted under Java Programming
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. What will be the output of the program?
Similar Questions
Discover Related MCQs
Q. Which of these keywords is used to by the calling function to guard against the exception that is thrown by called function?
View solution
Q. Which of these operator is used to generate an instance of an exception than can be thrown by using throw?
View solution
Q. Which of these class is related to all the exceptions that are explicitly thrown?
View solution
Q. Which of these keywords is used to generate an exception explicitly?
View solution
Q. What exception thrown by parseInt() method?
View solution
Q. Which of these handles the exception when no catch is used?
View solution
Q. Which of these class is related to all the exceptions that cannot be caught?
View solution
Q. Which of these class is related to all the exceptions that can be caught by using catch?
View solution
Q. Which of these is a super class of all exceptional type classes?
View solution
Q. Which of these classes is super class of Exception class?
View solution
Q. Which of these methods return localized description of an exception?
View solution
Q. Which of these methods is used to print stack trace?
View solution
Q. Which of these methods return description of an exception?
View solution
Q. Which of these classes is used to define exceptions?
View solution
Q. Which of these statements is incorrect?
View solution
Q. Which of these keywords are used for the block to be examined for exceptions?
View solution
Q. Which of these clause will be executed even if no exceptions are found?
View solution
Q. At runtime, error is recoverable.
View solution
Q. Which of the following should be true of the object thrown by a thrown statement?
View solution
Q. Which part of code gets executed whether exception is caught or not?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Java Programming? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!