Fifth International World Wide Web Conference
Java Built-in Types
- Each Java variable or expression has a definite type
- Java has a collection of built-in types for integer, floating point,
character, and logical data
- Each must have identical size and behavior on all Java implementations
- No need for conditional compilation directives
- New composite types constructed in terms of built-in types, classes, arrays
and interfaces
- There are 4 integer types, all with signed twos-complement values:
byte
(8 bits)
short
(16 bits)
int
(32 bits)
long
(64 bits)
- Expressions with mixed integer types will "widen" the smaller
type to the larger type
Java - An Introductory Language Tutorial
(E.A.Johnson)