(Choose 1 answer)
Given:
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?
A. 0.0
B. Compilation fails at line 15 with message about variable x not found.
C. A ParseException is thrown by the foo method at runtime.
D. A NumberFormatException is thrown by the foo method at runtime.
Q: 35