SCJP1.4
"Continuous effort - not strength or intelligence - is the key to unlocking our potential."
*Winston Churchill
The Inner that is named is not the true Inner.
SCJP1.4(96%)<br />A drop of ink can make millions think.
Originally posted by Steve Lovelace:
What we are giving to the method is a FloatingPointLiteral. (If you check the javadocs description of Float.valueOf() there is a link to the JLS definition of FloatingPointLiteral.) The gist of it is: you can append the "F" for Float but don't have to. In any case the value will be parsed and the compiler will complain only if the result is too big for a Float.
SCJP1.4
"Continuous effort - not strength or intelligence - is the key to unlocking our potential."
*Winston Churchill
Originally posted by Barkat Mardhani:
2. Any numerical argument that can be promoted to float, will be promoted.
SCJP1.4
"Continuous effort - not strength or intelligence - is the key to unlocking our potential."
*Winston Churchill
SCJP1.4(96%)<br />A drop of ink can make millions think.
The Inner that is named is not the true Inner.
Originally posted by Vicky Jain:
class wrapper1{
public static void main(String args[]){
Float f=new Float(5.6d);
}
}
can anyone explain me that why this code compiles fine & run even the Float wrapper class doesn't provide any constructor with double as argument, Float wrapper class contains only two constructors, one with float & other with string as argument.
SCJP1.4
"Continuous effort - not strength or intelligence - is the key to unlocking our potential."
*Winston Churchill