OPERATORS Flashcards
What are operators?
Operators are special symbols that perform specific operations on one, two, or three operands, and then return a result.
What is the operator precedence?
See phone for pic
What is an assignment operator?
’=’
• Its purpose is to assign the value on its right to the operand on its left. E.g.
• int marks = 0;
What is concatenation?
‘Adding’ two strings
What are unary operators?
- The unary operators require only one operand.
- They perform various operations such as incrementing/decrementing a value by one, negating an expression, or inverting the value of a boolean.
What are the three conditional operators?
- && Conditional-AND
- || Conditional-OR
- ?: - shorthand for an if-then-else statement
What are the bitwise and bit shift operators?
1.The unary bitwise complement operator “~” inverts a bit pattern; making every “0” a “1” and every “1” a “0”.
2.The signed left shift operator “<>” shifts a bit pattern to the right. The bit pattern is given by
the left-hand operand, and the number of positions to shift by the right-hand operand.
3.The unsigned right shift operator “»>” shifts a zero into the leftmost position, while the leftmost position after “»” depends on sign extension.
- The bitwise & operator performs a bitwise AND operation.
- The bitwise ^ operator performs a bitwise exclusive OR operation.
- The bitwise | operator performs a bitwise inclusive OR operation.
What is The Type Comparison Operator instanceof
- The instanceof operator compares an object to a specified type.
- One can use it to test if an object is an instance of a class, an instance of a subclass, or an instance of a class that implements a particular interface.
List all the types of operators
- Assignment Operators
- Arithmetic Operators
- Unary Operators
- Equality/Relational Operators
- Conditional Operators
- Bitwise Operators
- Bit Shift Operators
The do while asterisk thing
*see doc