GIAC
GSSP-JAVA · Question #66
Which of the following code fragments will throw NumberFormatException?
The correct answer is C. Float flt = new Float("true"). See the full explanation below for the reasoning.
Question
Which of the following code fragments will throw NumberFormatException?
Options
- ADouble dbl = new Double(true);
- BCharacter ch = new Character('A');
- CFloat flt = new Float("true");
- DBoolean bool = new Boolean("123");
How the community answered
(51 responses)- A6% (3)
- B10% (5)
- C80% (41)
- D4% (2)
Community Discussion
No community discussion yet for this question.