Skip to content

Data types

Mohamed Hassan edited this page Jan 16, 2026 · 4 revisions

Primitive data types:

  • byte:

    • A signed 8-bits of integer type, which has a minimum value of -128 and a maximum value of 127.
  • short:

    • A signed 16-bits of integer type, which has a minimum value of -32,768 and a maximum value of 32,767.
  • int:

    • A signed 32-bits of integer type, which has a minimum value of -231 and a maximum value of 231-1.
  • long:

    • A signed 64-bits of integer type, which has a minimum value of -263 and a maximum value of 263-1.
  • float:

    • A signed 32-bits of decimal type.
  • double:

    • A signed 64-bits of decimal type.
  • boolean:

    • Has only two possible values: true and false. Use this data type for simple flags that track true/false conditions. This data type represents one bit of information.
  • char:

    • Is a single 16-bits Unicode character. It has a minimum value of '\u0000' (or 0) and a maximum value of '\uffff'.

Non-primitive data types:

  • called reference types because they refer to objects
  • built-in types: Strings, Arrays, ...
  • custom data types as utilizing class construct to built your own type based on the business need


531400431-3b1842cf-4750-445b-b675-b8b26476a3fc

Clone this wiki locally