Primitive Type Summary

The table below summarizes Java's primitive types.

type namecategorysize (bits)size (bytes)min valuemax value
bytesigned integer81-256255
shortsigned integer162-32,76832,767
intsigned integer324-2,147,483,6482,147,483,647
longsigned integer648-9,223,372,036,854,775,8089,223,372,036,854,775,807
floatfloating-point324-3.4028235E383.4028235E38
doublefloating-point648-1.7976931348623157E3081.7976931348623157E308
charunsigned integer162065,535
booleanboolean81N/AN/A

A few notes about the above table:

  • The size is how much of the computer's memory a single value of this type requires
  • The char type represents a single text character, but it chars are stored as integers and will readily convert to an int
  • The main integer types are listed as signed, which means they can represent positive and negative numbers (and zero). An unsigned integer type (such as char) can only represent positive numbers (and zero).
  • The notation used for the min/max values of floating-point numbers is a form of scientific notation called "E notation". The E38 means "multiplied by 10^38," and the E308 means "multiplied by 10^308". These are extremely large numbers, which is why we write them with scientific notation.
  • The String type is not a primitive type and does not appear on the table