Page 175 - ComputerScience_Class_11
P. 175
Let’s Revisit
♦ Operators are used for doing calculations.
♦ There are many types of operators. They are Arithmetic operators, Assignment operators, Shorthand Operators, Relational
Operators, Logical Operators, Bitwise Operators and Shift Operators.
♦ There are different types of unary operators. They are Unary (+), Unary (-), Unary increment (++) and Unary decrement (--).
♦ Prefix Unary Operator executes on the principle of “Change Before Action”.
♦ Postfix Unary Operator executes on the principle of “Change After Action”.
♦ Shorthand Operator is a special compound assignment operator.
♦ Relational Operators compare two variables or expressions and result in true or false. There are six types of relational
operators. (>, >=, <, <=, ==, !=)
♦ Logical Operator is used to check whether an expression results in true or false. There are three types of logical operators.
♦ Conditional Assignment Operator or Ternary Operator consists of three operands which can be a variable, an expression or a
constant. It is also known as Ternary Operator. (?, :)
♦ When a conditional assignment operator is used under another is known as a nested conditional operator.
♦ Bitwise Operator performs bit-level calculations on the operands of data types - byte, short, int and long.
♦ Shift Operator is used to shift bits of the first operand to right or left one by one thus performing bit manipulation on data.
There are three types of Shift Operators in Java.
MIND DRILL
Solved Questions
A. Tick ( ) the correct option.
1. Which of the following operators is used to perform arithmetical calculations?
a. Binary operator b. Arithmetic operator
c. Logical operator d. Relational operator
2. Which of the following operators is used before the operand and returns the value with a reversed sign?
a. Prefix unary increment b. Postfix unary increment
c. Unary plus d. Unary minus
3. What do we call the unary increment operator when it is placed before the operand?
a. Prefix Unary Increment b. Postfix Unary Increment
c. Unary Plus d. Unary Minus
4. Which operator is used to assign a value or an expression to a variable?
a. Logical Operator b. Relational Operator
c. Assignment Operator d. Arithmetic Operator
5. What data type is returned by relational operators?
a. int b. double
c. float d. boolean
6. Which of the following logical operators results in true if both conditions are satisfied?
a. OR b. NOT
c. AND d. XOR
Variables and Expressions 173

