exam questions

Exam 1z0-811 All Questions

View all questions & answers for the 1z0-811 exam

Exam 1z0-811 topic 1 question 29 discussion

Actual exam question from Oracle's 1z0-811
Question #: 29
Topic #: 1
[All 1z0-811 Questions]

Given the code fragment:

What is the result?

  • A. false
    false
    false
    false
  • B. true
    false
    false
    false
  • C. true
    true
    true
    true
  • D. true
    true
    true
    false
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
___Anu___
7 months, 2 weeks ago
Selected Answer: C
All are true is the result that I got when compiled.
upvoted 1 times
...
aum0201
7 months, 3 weeks ago
T T T T System.out.println(a++ > 10 || ++b <= 21); System.out.println(" " + a + " " + b); System.out.println(a > 10 && ++b <= 22); System.out.println(" " + a + " " + b); System.out.println(a <= 11 && b == 22); System.out.println(" " + a + " " + b); System.out.println(c++ == 31 && a++ == 11 || b++ == 22); System.out.println(" " + a); System.out.println(" " + a + " " + b + " " + c); The expression becomes true || true, which is true. Value of a after this line: 12 Value of b after this line: 23 Value of c after this line: 31
upvoted 1 times
...
SabatinoA
8 months ago
I tried to insert on the compiler and the result is : true true false true.
upvoted 1 times
...
timecookie
9 months, 3 weeks ago
Selected Answer: D
The answer is D, because both prefix (++a) and postfix (a++) operators kept its result. E.g: After the first println System.out.println(a++ > 10 || ++b <= 21); The value of a is 11, therefore by the time it reaches the fourth println, a++ would already be 12, not 11.
upvoted 1 times
...
shmilany
10 months ago
Selected Answer: C
the answer is C
upvoted 1 times
...
Yousef10
11 months ago
Selected Answer: C
guys take care the output will be TRUE four times so the answer is C if you check it on the compiler you will get the same output i mention , because the || operator requires only one to be true.
upvoted 2 times
...
falchetto
1 year, 2 months ago
Selected Answer: D
Correct answer is D
upvoted 1 times
...
im2wishes
1 year, 4 months ago
C is the correct answer because the second part of D has post-increments so it's will stay 22 , the step after D B=23
upvoted 2 times
...
Andalusia
1 year, 4 months ago
The correct answer should be A. operand AND can only be true if both expression correct. OR can only be true if either one is correct.
upvoted 1 times
...
arjunec1
1 year, 6 months ago
Corret Answer should be D
upvoted 2 times
...
arjunec1
1 year, 6 months ago
Selected Answer: D
Corret Answer should be D
upvoted 2 times
...
Tonter
1 year, 7 months ago
answer is D
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago