To all
SCJP aspirants,
Make a note of the RETURN values of floor(),ceil(),and round() methods.
floor() - returns a double value
ceil() - returns a double value
round() - returns int,long value.
So the following code returns
float f = -3.2f;
System.out.println(Math.floor(f));
System.out.println(Math.ceil(f));
System.out.println(Math.round(f));
the values
-3.0
-3.0
-3 // an int.
Chandra