Exception Handling

© examsiri.com
Question : 1 of 24
 
Marks: +1, -0
Given:
1. public static void parse(String str) {
2.   try {
3.    float f = Float.parseFloat(str);
4.   } catch (NumberFormatException nfe) {
5.    f = 0;
6.   } finally {
7.    System.out.println(f);
8.   }
9. }
10. public static void main(String[] args) {
11.   parse("invalid");
12. }

What is the result?
Go to Question: