0% found this document useful (0 votes)
2 views1 page

Data Types

The document categorizes data types into two groups: Primitive and Non-Primitive. Primitive data types include basic types like byte, short, int, long, float, double, char, and boolean, each with specified bit sizes and examples. Non-Primitive data types are more complex and include types like String, Arrays, and user-defined types such as Classes and Interfaces.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Data Types

The document categorizes data types into two groups: Primitive and Non-Primitive. Primitive data types include basic types like byte, short, int, long, float, double, char, and boolean, each with specified bit sizes and examples. Non-Primitive data types are more complex and include types like String, Arrays, and user-defined types such as Classes and Interfaces.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

**Two different big groups of data types -

Primitive and Non-Primitive

**Primitive Data Types


Basic data types that hold simple values (not objects)

Typ Number of bits/


e 10^(x) What it stores Example
byte 8 Small whole numbers byte a = 10;
shor 16 Whole number (just a bit more than a short b = 2000;
t byte)
int 32 Normal whole numbers int c = 50000;
long 64 Very large whole numbers long d =
1000000000L;
float 32 Decimal numbers float e = 5.5f;
dou 64 Decimal numbers (more precise) double f = 19.99;
ble
char 16 Single characters/letter char g = ‘A’;
bool JVM dependent True or False values boolean h = true;
ean

Non-Primitive Data Types


These are more complex. They store references (addresses) of objects, not the actual
value directly.

Examp
Type What it stores le
String words/text
Arrays list of things
Classes, Objects, Interfaces, Enums user-defined/custom types

You might also like