What is displayed on the console when running the following program? public class Quiz2B { public static void main(String[] args) { try { System.out.println(“Welcome to Java”);
What is displayed on the console when running the following program?
public class Quiz2B
{
public static void main(String[] args)
{
try
{
System.out.println(“Welcome to Java”);
int i = 0;
int y = 2 / i;
System.out.println(“Welcome to Java”);
}
catch (RuntimeException ex)
{
System.out.println(“Welcome to Java”);
}
finally
{
System.out.println(“End of the block”);
}
}
}
options:
| The program displays Welcome to Java three times. |
| The program displays Welcome to Java two times. |
| The program displays Welcome to Java two times followed by End of the block. |
| The program displays Welcome to Java three times followed by End of the block. |