hi amit,
i have some notes.i think it will definitely help u.
1]The Float constructor is overloaded: one version accepts a primitive of type float; one accepts a primitive of type double; one accepts a String representation of a floating-point literal.
2]in constructors of wrapper classes ,arguments of type String can not contain an integer type suffix, L or l. A floating-point suffix, F, f, D or d, is acceptable.
suppose,
Which of the instance creation expressions produce a run-time
error?
a. new Float('A')
b. new Float("A")
c. new Float(1L)
d. new Float("1L")
e. new Float(0x10)
f. new Float("0x10")
g. new Float("010")
ans:b,d,f
explanation:
i]The Float constructor is overloaded: one version accepts a primitive of type float; one accepts a primitive of type double; one accepts a String representation of a floating-point literal
ii]The String literals "NaN" and "Infinity" are accepted by the Float constructor. A sign (+ or -) is optional.
iii]The primitive char literal 'A' is converted to a float, and is accepted by the constructor that declares a parameter of type float.
iv]The API specification states that any other String must represent a floating-point value;
v]The leading 0 of an octal value is ignored, and the String is
parsed as a decimal value. A String representation of a hexadecimal
value is not acceptable.
vi]The String "A" does not represent a floating-point literal
value; therefore, a NumberFormatException is thrown.
vii]Arguments of type String can not contain an integer type suffix, L or l. A floating-point suffix, F, f, D or d, is acceptable, but the suffix has no impact on the result.
i think this much is sufficient to clear ur first doubt.
now i am thinking about second.