M3 Flashcards
works on integer values, by manipulating its bit-pattern equivalent
bitwise operators
performs bit manipulation on data by
shifting the bits of its first operand right or
left.
shift operators
compares two values and determines the relationship between them.
relational operators
often used with relational operators to
construct more complex decision-making
expressions.
logical operators
used in converting one type into
another type or an object into another
object.
cast operators
Used to assign values to a variable
assignment operators
cast operators syntax
Syntax:
(Cast type) Value;
Example:
double dbl = 55.66;
int number = (int)dbl;
an operator that deals with three operands
Ternary Operator
Ternary Operator syntax
Syntax:
variable = condition ? value : value;
Example: int x = 20, y = 30; int biggerNumber = 0; biggerNumber = x>y ? x : y; // What do u think will be the value of the biggerNumber?