exam questions

Exam 1z0-808 All Questions

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

Exam 1z0-808 topic 1 question 136 discussion

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

Given:

What is the result?

  • A. Hello Log 1:0
  • B. Hello Log 2:1
  • C. Welcome Log 2:1
  • D. Welcome Log 1:0
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

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
v323rs
Highly Voted 3 years, 12 months ago
The correct answer C Welcome Log 2:1
upvoted 18 times
...
DriftKing
Most Recent 3 months, 3 weeks ago
Selected Answer: C
public class Test { public static void main(String args[]) { int x=1; int y=0; if(x++ > ++y) { //checks if(1>1) System.out.print("Hello "); } else { System.out.print("Welcome "); } System.out.print("Log "+x+":"+y); } }
upvoted 1 times
...
iSnover
1 year, 3 months ago
Selected Answer: C
The right answer is the letter C, because when we put "var++" the addition is done when leaving the condition or the line, but when we put "++var" the addition is done on the spot so 1 is not greater than 1, printing " Welcome" which is in Else and in the last line printing the XY with the additions made getting 2:1.
upvoted 3 times
...
Ayla
3 years, 2 months ago
Answer is C
upvoted 3 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