no title...

Page 42

an example, a math calculation cannot be performed on a boolean data type because a boolean cannot contain numbers. The following is a list of all eight primitive data types: Type

Width in Bits (Bytes)

boolean

Description/Range True or False values

byte

8-bit (1-byte)

-128 to 127

char

16-bit

Standard character set that can be a letter, control character, number, punctuation, or symbol representing all languages in the world

double

64-bit (8-byte)

-1.7976931348623157E+308 to 1.7976931348623157E+308

float

32-bit (4-byte)

-3.4028235E+38 to 3.4028235E+38

int

32-bit (4-byte)

−2,147,483,648 to 2,147,483,647

long

64-bit (8-byte)

-9,223,372,036,854,775,808 to 9,223,372,036,854,755,807

short

16-bit (2-byte)

-32,768 to 32,767

Figure 2.12 – Eight Primitive Data Types

The following divides the primitive data types into 4 categories:

Integer Type Floating Point Type Character Type Boolean Type


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.