Question 19 / 90:  Given the following code segment, what would be the output?
int value1 = 5;

int value2 = 7;

boolean bool1 = true;

boolean bool2 = false;

if (bool1 && (( value1 < value2 ) || bool2 ) && !(bool2)) {

System.out.println("Result set one");

} else {

System.out.println("Result set two");

}

A  Result set one
B  Result set two
<< First < Previous Next > Last >>
Explanation:

A. The expression in the if statement evaluates to true. This expression is actually easier than

it looks considering that bool1 is on the left side of a short-circuit operator.

B is incorrect.

Exam Home Page
https://www.jobilize.com/quiz-my-oca-mock-exam-by-mike-wolf

My OCA Mock

Author:

Access: Public Instant Grading

Ask
Copy and paste the following HTML code into your website or blog.
<iframe src="https://www.jobilize.com/embed/quiz-my-oca-mock-exam-by-mike-wolf" width="600" height="600" frameborder="0" marginwidth="0" marginheight="0" scrolling="yes" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>