Module 4: Mutating Information Flashcards
What is the operator?
A symbol that is used to perform operations
What are the different types of operators in Java?
Arithmetic Operators
Assignment Operators
Comparison Operators
Conditional/Logical Operators
What are your Arithmetic Operators?
+ addition
- subtraction
* multiplication
/ division
++ increment
- - decrement
What are your Assignment Operators?
= Example x = 10 Same as x = x = 10;
+= Example x += 10 Same x = x + 10;
-= Example x -= 10 Same as x = x - 10;
*= Example x *= 10 Same as x = x * 10;
/= Example x /= 10 Same as x = x / 10;
%= Example x %= 10 Same as x = x % 10;
&= Example x &= 10 Same as x = x & 10;
|= Example x |= 10 Same as x = x | 10;
^= Example x ^= 10 Same as x = x ^ 10;
»= Example x»_space;= 10 Same x = x»_space;10; «= Example x «= 10 Same as x = x «_space;10;
What are your Comparison Operators?
== Equal to
!= Not equal
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
What are your Conditional/Logical Operators?
&& Logical and returns true if both statements are true
|| Logical or returns true if one of the statements is true
! Not reverses the result. Return true if the result is false.