Thursday, June 27, 2013

Java primitive data types

  • byte, bits, -128 to 127
  • short, 16 bits, -32,768 to 32,767
  • int, 32 bits, -2.1 billion to 2.1 billion (approx)
  • long -9E18 to 9E18 (approx)
  • float, 32 bits, precision to about 4 to 5 decimal points
  • double, 64 bits, higher precision than float
  • char, 16 bits, unicode character storage, defaults to \u0000
  • boolean, 1 bit, defaults to false