Top Posters
Since Sunday
6
o
5
5
b
4
s
3
j
3
b
3
m
3
K
3
g
3
L
3
w
3
New Topic  
DragoxCM16 DragoxCM16
wrote...
Posts: 482
4 years ago
Analyze the following code:

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;
}
catch (Exception ex) {
System.out.println("NumberFormatException");
}
catch (RuntimeException ex) {
System.out.println("RuntimeException");
}
}
}


▸ The program displays RuntimeException.

▸ The program has a compilation error.

▸ The program displays NumberFormatException.

▸ The program displays NumberFormatException followed by RuntimeException.
Textbook 
Introduction to Java Programming, Comprehensive Version

Introduction to Java Programming, Comprehensive Version


Edition: 10th
Author:
Read 51 times
1 Reply
Replies
Answer verified by a subject expert
yesimshayyesimshay
wrote...
Posts: 360
4 years ago
Sign in or Sign up in seconds to unlock everything for free
More solutions for this book are available here

Related Topics

DragoxCM16 Author
wrote...

4 years ago
Thanks
wrote...

Yesterday
Thanks for your help!!
wrote...

2 hours ago
this is exactly what I needed
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  988 People Browsing
Related Images
  
 317
  
 8992
  
 4807
Your Opinion
Which 'study break' activity do you find most distracting?
Votes: 820