exam questions

Exam 1z0-808 All Questions

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

Exam 1z0-808 topic 1 question 34 discussion

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

Given the code fragment:

What is the result?

  • A. 2 4
  • B. 0 2 4 6
  • C. 0 2 4
  • D. Compilation fails
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
dya45792
Highly Voted 5 years, 7 months ago
antwort C , public static void main(String[] args) { int ii = 0; int jj = 7; for (ii = 0; ii < jj - 1; ii = ii + 2) { System.out.println(ii + " "); } } } 0 2 4
upvoted 12 times
...
M_Jawad
Highly Voted 5 years, 7 months ago
Answer is C
upvoted 6 times
...
vic88
Most Recent 8 months ago
Selected Answer: C
6 can't be less than jj-1 (7-1), so answer is C
upvoted 1 times
...
Kolodets
2 years, 3 months ago
when ii is 6, it cannot pass the condition, so it will not be printed
upvoted 1 times
...
Kolodets
2 years, 3 months ago
when C is 6, it cannot pass the condition, so it will not be printed
upvoted 1 times
...
Vicky_65
2 years, 4 months ago
Selected Answer: C
c is the correct
upvoted 1 times
...
Ankit1010
2 years, 5 months ago
C is right answer 0 2 4
upvoted 1 times
...
XalaGyan
3 years, 6 months ago
Selected Answer: C
C is correct
upvoted 1 times
...
alexandrustefanescu
4 years, 1 month ago
C is Correct!
upvoted 2 times
...
SSJ5
4 years, 4 months ago
Correct Answer is C
upvoted 2 times
...
szrertugrul
5 years, 3 months ago
Answer is D.. ii variable is already declared, and cannot be used in for loop. Will throw Unresolved compilation problem: Duplicate local variable ii
upvoted 1 times
Stewart125
4 years, 9 months ago
You are incorrect. The variable ii is never redeclared, you have mis-typed the question. If the reference to ii variable within the for loop had; for (int ii = 0 ..... then option D - compilation error would be correct, however the re-declaration is not in this question.
upvoted 2 times
...
...
mete23
5 years, 6 months ago
Answer is C
upvoted 6 times
...
v323rs
5 years, 6 months ago
I'm agree, the correct answer "C" 0 2 4
upvoted 5 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 ...