MODULE 3: Data types, variables, and operators Flashcards
Operators that perform basic mathematical operations such as addition, subtraction, multiplication, division, and modulus. Examples include +, -, *, /, and %.
Arithmetic Operators
Operators that operate on a single operand to perform operations like negation and incrementing. Examples include unary plus +, unary minus -, increment ++, and decrement –.
Unary Operators
Operators used to compare two values, returning a boolean result.
Relational Operators
Operators that combine multiple boolean expressions into one larger expression.
Logical Operators
Operators that assign values to variables, allowing for shorthand syntax for common operations. Examples include = (assignment), +=, -=, *=, /=, and %=.
Assignment Operators
The smallest data type in Java, used to save space in large arrays where memory is limited. It can hold values from -128 to 127.
Byte
A data type that can store numerical values slightly larger than byte, ranging from -32,768 to 32,767, useful for saving memory.
Short
A widely used data type for storing integer values, capable of holding a range from -2,147,483,648 to 2,147,483,647.
int
A data type used for larger integer values that exceed the limits of int, suitable for large counts or mathematical calculations.
long
A single-precision decimal value used for fractional numbers. It is less precise than double but useful for applications that prioritize memory efficiency.
float
A data type that provides double precision for decimal values, commonly used in scientific calculations for its accuracy.
double
A data type that represents a single 16-bit Unicode character, typically used to store individual characters in Java.
char
A data type used to flag true or false conditions, fundamental in control flow and decision-making in programming.
boolean