Primitive types and Literals

Reading Time: < 1 minute

There are 8 primitive types

  1. boolean
  2. char
  3. int
  4. long
  5. byte
  6. short
  7. double
  8. float

Boolean: one bit minimum capacity and has the value of true and false.

Char: 16 bit unsigned quantity hold character values. Range of value is 0 to 65,535.

Int: 32 bit signed quantity holds numbers. Range of value is -2,147,483,648 to 2,147,483,647.

Long: 64 bit signed quantity holds numbers. Range of value is -9,223,372,036,857,775,808 to 9,223,372,036,857,775,807.

Byte: 8 bit signed quantity holds numbers. Range of value is -128 to 127.

Short: 16 bit signed quantity holds numbers. Range of value is -32,768 to 32,767.

Double: 64 bit signed quantity holds double numbers. Range of value is about -1.7E308 to +1.7E308

Float: 32 bit signed quantity holds float numbers. Range of value is about 3.4E38 to 3.4E38