What is displayed on the console when running the following program?

```
public class Test {
public static void main (String[] args) {
try {
System.out.println("Welcome to Java");
return;
}
finally {
System.out.println("The finally clause is executed");
}
}
}```
a. Welcome to Java
b. Welcome to Java followed by The finally clause is executed in the next line
c. The finally clause is executed
d. None of the above

b The return statement exits the method, but before exiting the method, the finally clause is executed.

Computer Science & Information Technology

You might also like to view...

Which of the following declarations creates a two-dimensional array?

(A) Dim newVar(2, 2) As Double (B) Dim newVar As Integer (C) Dim newVar(2) As Double (D) Dim newVar(2)

Computer Science & Information Technology

What are the requirements when choosing an identifier for a C# class?

What will be an ideal response?

Computer Science & Information Technology