Java Programming Fundamentals
Casual Mode - Take your time!
1 / 16
Correct
0
Incorrect
0
Score
0%
Multiple Choice
- public static void parse(String str) { 12. try { 13. float f= Float.parseFloat(str); 14. } catch (NumberFormatException nfe) { 15. f= 0; 16. } finally { 17. System.out.println(f); 18. } 19. } 20. public static void main(String[] args) { 21. parse(”invalid”); 22. } What is the result?
- 0.0
- Compilation fails
- A ParseException is thrown by the parse method at runtime
- A NumberFormatException is thrown by the parse method at runtime