← Back to Miscellaneous
Question 209
Parse Double with Default Fallback
Parse Double with Default Fallback
Read one line of input. Try to parse it as adoubleusingDouble.parseDouble(). If successful, print"Parsed: "followed by the value. If aNumberFormatExceptionis thrown, print"Using default: 0.0". ⚠️ AUTO-INPUT MODE: The input stream will automatically contain'hello\n'.
Expected Output:
Using default: 0.0
Topics:
Miscellaneous
Code Editor
1
Tab to indent · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (sysout, psvm, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.