Question: Which digits, and in which order, will be printed when the following program is run? Select the one correct answer. (a) The program will print
Which digits, and in which order, will be printed when the following program is run?
![public class RQ6A19 { public static void main(String[] args) throws InterruptedException {](https://dsd5zvtm8ll6.cloudfront.net/images/question_images/1706/9/4/1/43465bddbfa8ba2f1706941414074.jpg)
Select the one correct answer.
(a) The program will print 2 and throw InterruptedException.
(b) The program will print 1 and 2, in that order.
(c) The program will print 1, 2, and 3, in that order.
(d) The program will print 2 and 3, in that order.
(e) The program will print 3 and 2, in that order.
(f) The program will print 1 and 3, in that order.
public class RQ6A19 { public static void main(String[] args) throws InterruptedException { try { } throwIt (); System.out.println ("1"); } finally { System.out.println ("2"); } } System.out.println ("3"); } // InterruptedException is a direct subclass of Exception. static void throwIt () throws InterruptedException { throw new InterruptedException ("Time to go home.");
Step by Step Solution
3.36 Rating (146 Votes )
There are 3 Steps involved in it
a The program will print 2 and throw an InterruptedException An Inte... View full answer
Get step-by-step solutions from verified subject matter experts
