Page 75 - CA_Blue( J )_Class10
P. 75
11. In the logical operator, which operator has the highest precedence?
Ans. In logical operator, the !(NOT) operator has the highest precedence.
12. Define the new operator. Give one example of it.
Ans. The "new" operator is used to assign space in the dynamic memory (RAM) to store the data members and methods that are parts
of an object. For example:
Sum ob = new Sum();
The new operator is used here to initialize the object ob of the class Sum.
13. Define the hierarchy of operators.
Ans. The hierarchy of operators decides the priority and order in which the Java operators are executed.
14. What is the associativity of the postfix unary operator?
Ans. The associativity of the postfix unary operator is right to left.
15. What is the "OR" operator?
Ans. If any one of the conditions in the expression satisfies, then the outcome is true otherwise false.
Example: (a > b) || (b < c).
D. Assertion and Reasoning based questions.
The following questions consist of two statements – Assertion (A) and Reason (R). Answer these questions by selecting the appro-
priate option given below:
a. Both A and R are true, and R is the correct explanation of A.
b. Both A and R are true, but R is not the correct explanation of A.
c. A is true, but R is false.
d. A is false, but R is true.
1. Assertion (A): The ternary operator in Java is represented by ? :
Reason (R): The ternary operator is used to perform conditional operations based on a boolean expression.
2. Assertion (A): The = operator in Java is used for comparison between two values.
Reason (R): The = operator is an assignment operator that assigns the value on the right to the variable on the left.
Ans. 1. a 2. d
Unsolved Questions
A. Tick ( ) the correct answer.
1. The ‘+’ operator is an example of ………………… operator.
a. Relational b. Logical
c. Arithmetic d. Assignment
2. Which of the following is an example of a postfix increment operator?
a. a+ b. a++
c. ++a d. +++a
3. Which of the following is an example of a prefix decrement operator?
a. i++ b. a--
c. --a d. ++a
4. Which of the following is the correct use of a ternary operator?
a. (a > b)?"a is greater than b" : "b is greater than a";
b. (a > b):"a is greater than b" ? "b is greater than a";
c. Both a and b
d. (a > b)? "a is greater than b" ; "b is greater than a";
5. Which of the following operators can we use to initialize all non-primitive data types?
a. Dot(.) operator b. Ternary operator
c. new operator d. relational operator
73
Operators in Java 73

