(13)
Answer (Choose 1 answer)
Given:
A. A ParseException is thrown by the foo method at runtime.
B. A NumberFormatException is thrown by the foo method at runtime.
C. 0.0
D. Compilation fails at line 15 with message about variable x not found.
11. public static void foo(String str) {
12. try {
13. float x = Float.parseFloat(str);
14. } catch (NumberFormatException e) {
15.
x = 0;
16. } finally {
17. System.out.println(x);
18. }
19.}
20. public static void main(String[] args) {
21. foo("invalid");
22.}
What is the result?