byte (signed 8 bit)
short (signed 16 bit)
char (unsigned 16 bit)
int (signed 32 bit)
long (signed 64 bit)
float (signed 32 bit floating point)
double (signed 64 bit floating point)
Note that char is an unsigned 16-bit numeric used to represent a Unicode character. It can in fact be cast to an integer type, e.g. byte. Also, all of the integer types (byte, short, char, int) are actually stored by the JVM as 32-bit integers. Any of those, as well as long, may be used with the switch statement. For the smaller values, the upper bits are simply ignored/discarded.
Java also supports "bigger" types by using the BigInteger and BigDecimal class types.
2006-11-09 19:18:32
·
answer #1
·
answered by vincentgl 5
·
1⤊
0⤋