Primitive Data Types in Depth

Java Data Types - 16 Cards
Click here to toggle all cards
Primitive Data types
Basic data types in Java including integers, booleans, and characters
byte
8-bit integer with a range of -128 to 127
short
16-bit integer with a range of -32,768 to 32,767
int
32-bit integer with a range of -2,147,483,648 to 2,147,483,647
long
64-bit integer with a range of -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
float
32-bit IEEE 754 floating-point number with a range of approximately 3.4E-38 to 3.4E+38
double
64-bit IEEE 754 floating-point number with a range of approximately 4.9e-324 to 1.8e+308
Typecasting
Process of converting one data type into another
Lossy conversion
Conversion that results in loss of information
Explicit Cast
A type conversion that is explicitly declared by the programmer.
BigDecimal
Java class for precise arithmetic operations on very large or very small numbers
Boolean
Data type that represents true or false values
A "||" operator
Logical operator used for OR operations
A "&&" operator
Logical operator that performs AND operation
Not operator
Represented by the exclamation mark (!) and is used to negate a boolean value
char
Data type that represents a single character