Data Primitives


sad


Data Type Size Useful for Minimum Value Maximum Value Default Value
Byte 8-bit signed two's compliment integer Saving memory in large arrays -128 127 0
Short 16-bit signed two's compliment integer Saving memory in large arrays -32,768 32767 0
Int 32-bit signed two's compliment integer Working with integral values, provides a value range large enough to deal with most scenarios -2,147,483,647 2,147,483,647 0
Long 64-bit signed two's compliment integer Scenarios in which a range of values higher than what is provided by 'int' is needed -9,223,372,036,854,775,808 9,223,372,036,854,775,807 0L
Float Single-precision 32-bit IEEE 754 floating point Saving memory in large arrays of floating point numbers 1.40129846432481707e-45 3.40282346638528860e+38 0.0f
Double Double-precision 64-bit IEEE 754 floating point Decimal values, though not recommended for accurate numbers 4.94065645841246544e-324d 1.79769313486231570e+308d 0.0d
Boolean 1-bit Scenarios or conditions which have only two possible values needed N/A N/A false
Char Single 16-bit Unicode character Scenarios needing only a single character \u0000 (or 0) \uffff (or 65,535 inclusive) \u0000

Valid XHTML 1.0 Transitional Site created by: Adam Hoang