MCQOPTIONS
Bookmark
Saved Bookmarks
→
Java Programming
→
Exceptions
→
Which of the following blocks execute compulsorily...
1.
Which of the following blocks execute compulsorily whether exception is caught or not.
A.
inally
B.
atch
C.
hrows
D.
hrow
Answer» B. atch
Show Answer
Discussion
No Comment Found
Post Comment
Related MCQs
and given that all methods of class , including , throw an , which of these is true?
Which four can be thrown using the throw statement?
and given that and are both subclasses of , and further assuming this block of code is placed into a class, which statement is most true concerning this code?
What is the output of this program?public class Exec_Handling_Example { public static void main(String args[]) { try { int k, n; n = 5; for (k = -2; k < 2 ;++k) { n = (n / k); System.out.print(k); } } catch(ArithmeticException e) { System.out.print("0"); } } }
What is the output of this program?public class Exep_Handling_Example { public static void main(String args[]) { try { int p, q; p = 0; q = 15/p; } catch(ArithmeticException e) { System.out.print("Welcome to "); } finally { System.out.print("Interview Mania"); } } }
What is the output of this program?public class Null_Pointer_Exception { public static void main(String args[]) { try { System.out.print("First"); throw new NullPointerException ("Interview Mania"); } catch(ArithmeticException e) { System.out.print("Second"); } } }
What is the output of this program?public class Array_Exception { public static void main(String args[]) { try { int p = args.length; int q = 12 / p; System.out.print(p); try { if (p == 1) p = p / p - p; if (p == 2) { int []s = {1}; s[10] = 8; } } catch (ArrayIndexOutOfBoundException e) { System.out.println("First"); } } catch (ArithmeticException e) { System.out.println("Second"); } } }
What is the output of this program?public class Result { public static void main(String args[]) { try { int p = 2; int q = 9; int s = p / q; System.out.print("First"); } catch(Exception e) { System.out.print("Second"); } } }
What is the output of this program?public class Without_Catch{ public static void main(String args[]) { try { System.out.print("Interview Mania "); } finally { System.out.println("Finally executed.. "); } }}
What is the output of this program?public class Finally_Example { public static void main(String[] args) { try { return; } finally { System.out.println( "Finally block executed..." ); } } }
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply
Your experience on this site will be improved by allowing cookies. Read
Cookie Policy
Reject
Allow cookies