Quick Index
Overview


We create objects from classes (Java's classes and classes we have created). These classes and objects will generally handle most of our coding needs.

Java, however, does have a special type of data called primitives.

Primitives are not proper objects -- we cannot send messages to them, e.g. aPrim.toString() is not allowed.

Primitives are useful when operators are utilized (we'll learn about operators next).

Primitive Data Types Listing


TypeContainsDefaultSizeRange
intSigned integer032 bits-2147483648 to 2147483647
doubleIEEE 754 floating point064 bits+/-4.9E-324 to +/-1.7976931348623157E+308
booleantrue or falsefalse1 bittrue of false
charUnicode character\u000016 bitsU+0000 to U+FFFF
byteSigned integer08 bits-128 to 127
shortSigned integer016 bits-32768 to 32767
longSigned integer064 bits-9223372036854775808 to 9223372036854775807
floatIEEE 754 floating point032 bits+/-1.4E-45 to +/-3.4028235E+38

We're already familiar with int, double and boolean.