A data type, or type is a classification of a particular kind of information. It can be defined by its permissable values and operations.


When programming, the following data types usually exist in one form or another:

integer

a number that has no fractional part or exponent, often described as a whole number, e.g. 123

In some programming languages, an integer can be defined as signed or unsigned. A signed integer can be either positive or negative (depending on its sign: + or -); an unsigned integer is always positive. The absolute value of an integer is its value regardless of sign, for example 123 and -123 both have an absolute value of 123.

floating-point

a number with a decimal point and/or exponent, e.g. 12.3, 1.23e4

An exponent represents ten to the power of its value. For example, 1.23e4 represents 1.23*104.

boolean

a boolean value, e.g. true, false

A boolean value is a binary value: it can only be in one of two states. The states are sometimes represented by true or false, and are sometimes represented by 1 or 0.

character

a text character, e.g. 'a'

string

readable text, e.g. "hello"

The type of an entity is specified using a data type specifier, sometimes called a type specifier.

Primitive Data Type

A primitive data type is a data type provided as a basic building block by a programming language. It is predefined by the programming language and is named by a reserved keyword or keywords.


example GCC C++
Borland C++ Compiler
Java
home Home Page