1/20
These flashcards are designed to review key concepts related to Java operators, including mathematical, comparison, and logical operators.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
What are operators in Java?
Operators are symbols that tell Java to perform operations on items.
What is the purpose of mathematical operators in Java?
To perform calculations such as addition, subtraction, multiplication, and division.
What does the ‘+’ operator do in Java?
The ‘+’ operator is used for addition.
What is the function of the ‘-’ operator in Java?
The ‘-’ operator is used for subtraction.
What does the ‘/’ operator represent?
The ‘/’ operator is used for division.
What is the role of the ‘*’ operator?
The ‘*’ operator is used for multiplication.
What does the modulus operator ‘%’ do in Java?
It returns the remainder of a division operation.
What is PEMDAS in arithmetic operations?
PEMDAS is the order of operations: Parentheses, Exponents, Multiplication and Division, Addition and Subtraction.
How do you assign a value to a variable in Java?
Use an equal sign '='.
What does '+=’ do when used with a variable?
It adds a specified value to the variable.
How do you compare values in Java?
Use comparison operators like '==', '>', '
What does the operator '==' signify?
It checks if two values are equal.
What does the operator '!=' indicate?
It checks if two values are not equal.
What does '>' mean when used as a comparison?
It checks if the left value is greater than the right value.
What does '<' signify in comparison operations?
It checks if the left value is less than the right value.
How would you express 'greater than or equal to' in Java?
Use the operator '>='.
How do you express 'less than or equal to' in Java?
Use the operator '<='.
What does '&&' represent in logical expressions?
It represents 'AND', returning true only if both conditions are true.
What is represented by '||' in logical expressions?
It represents 'OR', returning true if at least one condition is true.
What does '!' mean in logical operations?
It negates the result, meaning 'NOT'.
What does long division correlate with in programming?
It correlates with the remainder in division, handled by the modulo operator.