header

Simple Data Types

Numeric

Numeric data types are used to store numbers. The int data type is used to store integer values. There are some other integer data types but the int data type will suffice for most purposes.

Type Size (in bytes) Minimum Maximum
int 4 -2,147,483,648 2,147,483,647

The double data type is used to store floating point values (numbers with an integer part and a fraction part). There is another floating point data type but the double data type will suffice for most purposes. The given minimum and maximum values are for positive values. These values, with a minus sign, would also delimit the range of negative values. Of course, zero is also included in the double data type.

Type Size (in bytes) Precision (Decimal Digits) Minimum Maximum
double 8 Double (about 15) 2.22507e-308 1.79769e+308

Character

Character data consists of letters, numerals, punctuation, and some additional characters (such as tab, form feed, new line, and carriage return). The char data type stores a single character while the string data type stores a sequence of characters. Technically, the string data type is a class (a data structure for storing multiple character values and the code to manipulate that data structure). In many ways, however, a string can be used as easily as if it was a simple data type.

Type Description
char A simple data type. Stores a single character.
string A class. Stores a sequence of characters.

Logical

The bool data type is used to store a logical value ( true or false).

Type Size (in bytes) Value
bool  1 true or false