Programming - Operators
You Are Here :: Home > JAVA > Operators - General Questions
19.
Conditional operators return __________ value based on the state of the variables
A.
TRUE
B.
a true or a false
C.
FALSE
D.
both a and c
Answer: Option B
Explanation:
Conditional operators return a true or afalse value based on the state of the variables i.e. the operations using conditional operators are performed between the two boolean expressions.
20.
The AND (&) operator is similar to the __________.
A.
logical AND
B.
Conditional-AND operator (&&)
C.
both a and b
D.
all the above
Answer: Option B
Explanation:
The AND (&) operator is similar to the Conditional-AND operator (&&).
21.
The "|" operator always evaluates both of its operands and returns___________ if one or other of its operand is___________.
A.
true,true
B.
true,false
C.
false,true
D.
false,false
Answer: Option A
Explanation:
The "|" operator always evaluates both of its operands and returns true if one or other of its operand is true.
22.
The _______ operator performs the boolean NOT operation on a single operand or an expression.
A.
Boolean Negation Operator
B.
NOT ("!")
C.
Boolean operator
D.
all the above
Answer: Option B
Explanation:
The NOT ("!") operator performs the boolean NOT operation on a single operand or an expression.
23.
_________________ checks the boolean status of a current operand or expression and reverses the value of a boolean expression
A.
NOT(!)
B.
logical NOT
C.
both a and b
D.
none
Answer: Option A
Explanation:
checks the boolean status of a current operand or expression and reverses the value of a boolean expression i.e. if the current value of an operand or expression is true then it reverses as false; but if the value of an operand or expression is false then it reverses as true.
24.
Java supports another conditional operator that is known as the _________ operator "?:"
A.
Unary
B.
ternary
C.
binary
D.
all the above
Answer: Option B
Explanation:
Java supports another conditional operator that is known as the ternary operator "?:"
« prev
next »