Solved

What Is Displayed on the Console When Running the Following

Question 21

Multiple Choice

What is displayed on the console when running the following program? class Test {
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") ;
}
}
}


A) The program displays Welcome to Java three times followed by End of the block.
B) The program displays Welcome to Java two times followed by End of the block.
C) The program displays Welcome to Java three times.
D) The program displays Welcome to Java two times.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions