Review Questions |
5.15 |
Which digits, and in which order, will be printed when the following program is run?
public class MyClass { public static void main(String[] args) { int k=0; try { int i = 5/k; } catch (ArithmeticException e) { System.out.println("1"); } catch (RuntimeException e) { System.out.println("2"); return; } catch (Exception e) { System.out.println("3"); } finally { System.out.println("4"); } System.out.println("5"); } } Select the one correct answer.
|
Get Programmer's Guide to Java™ Certification, A: A Comprehensive Primer, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.