This is the reference section for the primitive data types that are used in the Java programming language. Primitive data types are like the atoms of the data types. They are the smallest units in the language and they can be assembled into larger data types, like molecules.
There are four essential types of primitives: integers, floating-point numbers, characters, and booleans. Of the integers, there are four variants of differing sizes: byte, short, int, and long. For floating-point types, there are to types: float and double. Finally, there is one type each for characters and booleans: char and boolean, respectively. The characteristics of each of these types is summarized in the table below.
These are the primitive data types that are used in the Java programming language.
| Name | Data | Range | Default Value | Size |
|---|---|---|---|---|
| byte | signed integer | [-128, 127] | 0 | 8 bits |
| short | signed integer | [-32768, 32767] | 0 | 16 bits |
| int | signed integer | [-2147483648, 2147483647] | 0 | 32 bits |
| long | signed integer | [-9223372036854775808, 9223372036854775807] | 0 | 64 bits |
| float | floating-point | MIN: ±1.4E-45 MAX: ±3.4028235E+38 | 0.0 | 32 bits |
| double | floating-point | MIN: ±4.9E-324 MAX: ±1.7976931348623157E+308 | 0.0 | 64 bits |
| char | Unicode | ['\u0000', '\uFFFF'] | '\u0000' | 16 bits |
| boolean | logical value | {false, true} | false | ≥ 1 bit |
In addition to these primitive types, Java contains the built-in aggregate types for strings and arrays.
© 20072025 XoaX.net LLC. All rights reserved.