Concept Explanation: Primitive Data Types

Printer-friendly version


At the most general level, everything in a program can be separated into two general groups: Commands and Data. The main difference between these groups is the ability to store information. Commands can only perform actions while data is information that can be acted upon.

The main data types that we will work with are:

  • Integer – Whole numbers. Examples: 1, 5, 47, 100
  • String – Text characters. Examples: “Hello” , “NXT” , “Fifty-Five”

It is important to note that the NXT can only understand a data of a certain size. Limitations within the design limit the size of strings to 19 characters and integers to approximately 37,000. If your data is larger than the limit, you will need to break it into multiple chunks.

There are more data types out there, and we will explore them as we use them. Right now, Strings and integers will give us the ability to work with words and numbers.