subject

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

public class Test {
public static void main(String[] args) {
try {
p();
System. out. println("After the method call");
}
catch (NumberFormatException ex) {
System. out. println("NumberFormatException"); }
catch (RuntimeException ex) {
System. out. println("RuntimeException");
}
}

static void p() {
String s = "5.6";
Integer. parseInt(s); // Cause a NumberFormatException

int i = 0;
int y = 2 / i;
System. out. println("Welcome to Java");
}
}

A. The program displays NumberFormatException.
B. The program displays NumberFormatException followed by After the method call.
C. The program displays NumberFormatException followed by RuntimeException.
D. The program has a compile error.
E. The program displays RuntimeException.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:30
You are almost finished updating a web site. as part of the update, you have converted all pages from html 4.0 to html5. the project is currently on schedule. however, your project manager has been asked by the marketing team manager to justify a day of time spent validating the site's html5 pages. the marketing team manager does not have technical knowledge of the internet or the web. which is the most appropriate explanation to provide to the marketing team manager?
Answers: 1
question
Computers and Technology, 22.06.2019 15:10
Which activity should be part of a long-term plan to positively affect yourhealth? oa. wearing regular clothing when handling toxinsob. not worrying about secondhand smokeoc. avoiding excessive exposure to sunlightod. drinking only well water
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
Which location-sharing service offers items for users as a gaming component and also allows them to collectively link their check-ins to publish a trip? a. whrrl b. buzzd c. foursquare (this option is wrong i already tried) d. gowalla for plato
Answers: 2
question
Computers and Technology, 23.06.2019 14:00
Technician a says that with self-adjusting clutch systems, the release bearing constantly rotates. technician b says that the ball bearing portion of the release bearing should be lubricated with high-temperature grease during routine maintenance. which technician is correct?
Answers: 2
You know the right answer?
What is displayed on the console when running the following program?

public class Test {...
Questions
question
Mathematics, 05.07.2019 06:00
question
History, 05.07.2019 06:00
question
Mathematics, 05.07.2019 06:00
Questions on the website: 13722362