Primitive

In computer science, a primitive is a fundamental data type that cannot be broken down into a more simple data type. For example, an integer is a primitive data type, while an array, which can store multiple data types, is not.

Some programming languages support more data types than others and not all languages implement data types the same way. However, most high-level languages share several common primitives.

Java, for instance, has eight primitive data types:

  1. boolean – a single TRUE or FALSE value (typically only requires one bit)
  2. byte – 8-bit signed integer (-127 to 128)
  3. short – 16-bit signed integer (-32,768 to 32,767)
  4. int – 32-bit signed integer (-231 to -231 -1)
  5. long – 64-bit signed integer (-263 to -263 -1)
  6. float – 32-bit floating point number
  7. double – 64-bit floating point number
  8. char – 16-bit Unicode character
The string data type is generally considered non-primitive since it is stored as an array of characters.

Primitives supported by each programming language are sometimes called "built-in data types" since they store values directly in memory. Non-primitive data types store references to values rather than the values themselves. Examples of non-primitive Java data types include arrays and classes.

Updated May 23, 2019 by Per C.

quizTest Your Knowledge

How many bits is a virtual channel identifier (VCI) in an ATM cell?

A
8
0%
B
16
0%
C
24
0%
D
32
0%
Correct! Incorrect!     View the VCI definition.
More Quizzes →

The Tech Terms Computer Dictionary

The definition of Primitive on this page is an original definition written by the TechTerms.com team. If you would like to reference this page or cite this definition, please use the green citation links above.

The goal of TechTerms.com is to explain computer terminology in a way that is easy to understand. We strive for simplicity and accuracy with every definition we publish. If you have feedback about this definition or would like to suggest a new technical term, please contact us.

Sign up for the free TechTerms Newsletter

How often would you like to receive an email?

You can unsubscribe or change your frequency setting at any time using the links available in each email.

Questions? Please contact us.