Programming - Operators
You Are Here :: Home > JAVA > Operators - General Questions
7.
The________ requires only one operand to perform different kind of operations such as increasing/decreasing a value, negating an expression, or inverting a boolean value.
A.
Bitwise operator
B.
unary operator
C.
left shift operator
D.
right shift operator
Answer: Option B
Explanation:
The unary operators requires only one operand to perform different kind of operations such as increasing/decreasing a value, negating an expression, or inverting a boolean value.
8.
____________________ operators can not be used with final variables.
A.
Unary Operators
B.
Assignment operators
C.
Arithmetic operators
D.
new operator
Answer: Option A
Explanation:
Unary Operators operators can not be used with final variables.
9.
Unary plus operator (+) indicates positive value. This (+) operator is used to perform which operation on an operand?
A.
type conversion
B.
increment operation
C.
both a and b
D.
none
Answer: Option A
Explanation:
Unary plus operator (+) indicates positive value. This (+) operator is used to perform type conversion operation on an operand
10.
Unary minus operator (-) indicates negative value and differ from the ________ operator.
A.
Bitwise operator
B.
unary operator
C.
unary plus
D.
new operator
Answer: Option C
Explanation:
Unary minus operator (-) indicates negative value and differ from the unary plus operator.
11.
________________ operator is also used to perform a type conversion operation on an operand.
A.
Unary Minus
B.
unary plus
C.
both a and b
D.
all the above
Answer: Option A
Explanation:
Unary Minus operator is also used to perform a type conversion operation on an operand.
12.
The increment/decrement operators can be a ____________.
A.
infix or a postfix
B.
prefix or a postfix
C.
infix or a prefix
D.
none
Answer: Option B
Explanation:
The increment/decrement operators can be a prefix or a postfix.
« prev
next »