17. The following method is designed to convert an input string
to a floating point number, while detecting a bad format.
Assume that factor is correctly defined elsewhere:
public boolean strCvt( String s ){
try {
factor = Double.valueOf( s ).doubleValue();
return true ;
} catch(NumberFormatException e){
System.out.println("Bad number " + s );
factor = Double.NaN ;
}finally { System.out.println("Finally");
}
return false ; }
Which of the following descriptions of the results of various
inputs to the method are correct? Select all possible answers:
A. Input = "0.234"
Result:factor = 0.234, "Finally" is printed, true is returned.
B. Input = "0.234"
Result:factor = 0.234, "Finally" is printed, false is returned.
C. Input = null
Result:factor = NaN, "Finally" is printed, false is returned.
D. Input = null
Result:factor unchanged,"Finally" is printed,
NullPointerException is thrown.