Java MCQ Questions and Answers Logical Operators 1

Study and learn Java MCQ questions and answers on Logical Operators and their priorities. Attend job interviews easily with these Multiple Choice Questions.

Go through Java Theory Notes on Logical Operators before reading these questions.



1) What are the two possible Logical Operator types?
A) Bitwise Logical
B) Boolean Logical
C) Arithmetic Logical
D) A and B
Answer [=]
Answer[=]
2) Boolean logical operators in Java work with?
A) true/false boolean data
B) 1 and 0 of individual Bits
C) characters of a String
D) None of the above
Answer [=]
Answer[=]
3) Bitwise logical operators in Java work with?
A) true/false boolean data
B) 0 and 1 individual bits of data
C) Characters of a String
D) None of the above
Answer [=]
Answer[=]
4) In general Bitwise logical operators are simply called?
A) Logical operators
B) Bitwise operators
C) Binary operators
D) None of the above
Answer [=]
Answer[=]
5) What is the input for Logical Operators?
A) 1 and 0
B) true / false
C) char / String
D) None of the above
Answer [=]
Answer[=]
6) What is the output of any Logical operation in Java?
A) 1 or 0
B) true or false
C) char or String
D) None of the above
Answer [=]
Answer[=]
7) Which is the Logical operator in Java that works with a Single Operand?
A) Logical AND
B) Logical OR
C) Logical Exclusive OR
D) Logical NOT
Answer [=]
Answer[=]


 

8) Which among the following is a Logical Unary NOT operator in Java?
A) ~
B) !
C) #
D) ^
Answer [=]
Answer[=]
9) What is the output of the Java code snippet?
boolean b=false;
b = !b;
System.out.println(b);
A) true
B) false
C) Compiler error
D) None of the above
Answer [=]
Answer[=]
10) Which among the following is a Short Circuit AND operator?
A)
&
B)
&&
C)
|
D)
||
Answer [=]
Answer[=]
11) Which among the following is a Short Circuit OR operator?
A)
&
B)
&&
C)
|
D)
||
Answer [=]
Answer[=]
12) What is the output of a Logical OR (|) operation if one of the inputs/operands is false?
A) false
B) true
C) true or false
D) None of the above
Answer [=]
Answer[=]
13) What is the output of Logical AND (&) operation if one of the inputs/operands is false?
A) false
B) true
C) true or false
D) None of the above
Answer [=]
Answer[=]
14) What is the output of a Logical OR (|) operation if one of the inputs/operands is true?
A) false
B) true
C) true or false
D) None of the above
Answer [=]
Answer[=]


 

15) What is the output of a Logical AND (&) operation if one of the inputs/operands is true?
A) false
B) true
C) true of false
D) None of the above
Answer [=]
Answer[=]
16) What is the output of a Logical AND (&) operation if both inputs/operands are true?
A) false
B) true
C) true or false
D) None of the above
Answer [=]
Answer[=]
17) What is the output of a Logical OR (|) operation if both the inputs/operands are true?
A) true
B) false
C) true or false
D) None of the above
Answer [=]
Answer[=]
18) Which is fast among AND (&) and Short Circuit AND(&&) operators in Java?
A) AND operator
B) Short Circuit AND
C) Both work at the same speed
D) None of the above
Answer [=]
Answer[=]
19) Which is fast among OR(|) and Short Circuit OR (||) operators in Java?
A) OR Operator
B) Short Circuit OR operator
C) Both work at the same speed
D) None of the above
Answer [=]
Answer[=]
20) Why are Short Circuit AND (&&) and Short Circuit OR (||) operators are fast in Java?
A) By skipping the second expression or operand if possible and save time.
B) By using extra memory on the machine
C) By using extra CPU processing power
D) None of the above
Answer [=]
Answer[=]


Like or Share

Show some care. Like or Subscribe. [FB]...[Youtube]

C MCQ App by ExamTray 

Android APP

Java MCQ App by ExamTray 

Android APP
ALL MCQ App by ExamTray Android APP

Ad

 

Try Some Java Books

Book Price
1. Java - The Complete Reference  Check Price
2. Core Java: An Integrated Approach, Black Book Check Price
3. Java All-in-One for Dummies Check Price
4. OCP Java SE 8: Programmer II Check Price
5. Programming with Java Check Price
6. Head First Java Check Price

We may get some affiliate commission for the above purchases.