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 {

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

1 Expert Approved Answer
Step: 1 Unlock

a The program will print 2 and throw an InterruptedException An Inte... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming 8th Questions!