posted 23 years ago
Math.ceil() and Math.floor() are methods.
System.out.println(Math.floor(3.2) == 3); // prints 'true'
System.out.println(Math.ceil(3.2) == 4); // prints 'true'
Watch you capitalization. byte, short, int, long, float, and double are the primitives for representing numbers, while Byte, Short, Integer, Long, Float, and Double are objects for representing numbers.
I don't really want to give a detailed explination about the number primitives, but heres a quick overview:
byte, short, int, and long represent signed integers (42, 0, -3)
float and double represent signed decimal numbers (3.0, -2.4, 0.5)
byte holds numbers from -128 to 127
short: -32768 to 32767
int: -2147483648 to 2147483647
long: -9223372036854775808 to 9223372036854775807
The numbers that the floating point types (float and double) can hold are in a very different format, so it does not make sense to give ranges for them.