exam questions

Exam 1z0-808 All Questions

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

Exam 1z0-808 topic 1 question 229 discussion

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

Given the code fragment:



Which code fragments, inserted at line n1 independently, print The Top element: 30? (Choose two.)

  • A.
  • B.
  • C.
  • D.
  • E.
Show Suggested Answer Hide Answer
Suggested Answer: BC 🗳️

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
MPignaProTech
2 months, 2 weeks ago
Selected Answer: BC
BC are correct
upvoted 1 times
...
ManuTov
1 year, 3 months ago
correct: BC -> 30 A -> 20 DE -> IndexOutOfBoundsException
upvoted 2 times
...
DriftKing
1 year, 4 months ago
Selected Answer: BC
B. while (idx < size - 1) { idx++; } C. do { idx++; } while (idx < size - 1); C.
upvoted 2 times
...
Ericausdresden
1 year, 5 months ago
Selected Answer: BC
tested
upvoted 2 times
...
sina_
1 year, 5 months ago
Selected Answer: BC
b c correct
upvoted 2 times
...
sina_
1 year, 5 months ago
Selected Answer: AC
public static void main(String[] args) { int[] stack = {10, 202, 30}; int size = 3; int idx = 0; //A OK do { idx++; } while (idx < size - 1); //B NOT // while (idx < size - 1) { // idx++; // } //C OK do{ idx++; }while (idx<size-1); //D NOT // do{ // idx++; // }while(idx<=size); //E NOT // while(idx<=size-1){ // idx++; // } System.out.println("the top element :" + stack[idx]); }
upvoted 2 times
...
jackymak
1 year, 5 months ago
Selected Answer: BC
Correct
upvoted 1 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