Take a Quiz
All Products
Brain Games
ProProfs.com
Change Image Delete
Public static void parse(String str) { try { float f = Float.parseFloat(str); } catch (NumberFormatException nfe) { f = 0; } finally { System.out.println(f); } } public static void main(String[] args) { parse("invalid"); }
Answered Aug 05, 2020
A NumberFormatException is thrown by the parse method at runtime.
Answered Oct 30, 2017
Forgot your password?