Solved

Analyze the Following Program. Class Test

Question 21

Multiple Choice

Analyze the following program. class Test {
Public static void main(String[] args) {
Try {
String s = "5.6";
Integer.parseInt(s) ; // Cause a NumberFormatException
Int i = 0;
Int y = 2 / i;
System.out.println("Welcome to Java") ;
}
Catch (Exception ex) {
System.out.println(ex) ;
}
}
}


A) An exception is raised due to Integer.parseInt(s) ;
B) An exception is raised due to 2 / i;
C) The program has a compilation error.
D) The program compiles and runs without exceptions.

Correct Answer:

verifed

Verified

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

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents