1Z0-811 Primitives, Strings and Operators Practice Question
Which two of the following operators are logical operators in Java? (Choose two.)
⚠ Common exam trap
A common mix-up: candidates confuse bitwise operators (&, |) with logical operators (&&, ||) because they look similar, but Java treats them distinctly based on operand types and evaluation behavior.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
||
|| is the logical OR operator in Java, which returns true if at least one of the two boolean operands is true. Option C is correct because && is the logical AND operator, which returns true only if both boolean operands are true. Both operators perform short-circuit evaluation, meaning the right operand is not evaluated if the result is already determined by the left operand.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
||
Why this is correct
Correct: || is the logical OR operator.
- ✗
&
Why it's wrong here
Incorrect: & is the bitwise AND operator.
- ✓
&&
Why this is correct
Correct: && is the logical AND operator.
- ✗
|
Why it's wrong here
Incorrect: | is the bitwise OR operator.
- ✗
~
Why it's wrong here
Incorrect: ~ is the bitwise NOT operator.
Go deeper
Related to this question
About these practice questions
This 1Z0-811 question is part of Courseiva's 481-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 1Z0-811 practice question is part of Courseiva's free Oracle certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 1Z0-811 exam.