exam questions

Exam 1z0-808 All Questions

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

Exam 1z0-808 topic 1 question 165 discussion

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

Given the code fragment:

And given the requirements:
1. Process all the elements of the array in the reverse order of entry.
2. Process all the elements of the array in the order of entry.
3. Process alternating elements of the array in the order of entry.
Which two statements are true? (Choose two.)

  • A. Requirements 1, 2, and 3 can be implemented by using the enhanced for loop.
  • B. Requirements 1, 2, and 3 can be implemented by using the standard for loop.
  • C. Requirements 2 and 3 CANNOT be implemented by using the standard for loop.
  • D. Requirement 2 can be implemented by using the enhanced for loop.
  • E. Requirement 3 CANNOT be implemented by using either the enhanced for loop or the standard for loop.
Show Suggested Answer Hide Answer
Suggested Answer: BD 🗳️

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, 3 weeks ago
Selected Answer: BD
BD are the good answers
upvoted 1 times
...
ann_9624
1 year ago
Selected Answer: DE
finding true answer so D,E
upvoted 1 times
...
akbiyik
2 years, 1 month ago
Selected Answer: BD
The correct answer is BD
upvoted 2 times
...
iSnover
2 years, 3 months ago
Selected Answer: BD
Wrong, the correct answer is BD. and here's the explanation: * Standard For -> You can process all elements in reverse by putting the condition of " >=0", ">0" and putting in the increment "--var", "var--". You can put an alternating sequence by moving the increment, for example, if you want to jump from 2 to 2 places, in the for increment field you put "var = var +2" that will compile. About the correct sequence any for does. * Enchanced for -> You can only loop through the elements in the order of entry, you can't do it in reverse or alternately, as in enchanced for you access each element of the collection scalable (from smallest to largest in position).
upvoted 1 times
iSnover
2 years, 3 months ago
With these concepts, let's answer the questions: A -> Wrong, you cannot implement option 1 (reverse entry) and 3 (alternaty entry) in an enchanced for B -> Correct, you can use options 1,2,3 and a standard for C -> Wrong, you can implement option 2 (normal entry) and 3 (alternaty entry) in a Standard for D -> Correct, you can implement option 2 (normal entry) in an enchanced for And -> Incorrect, you can implement option 3 (alternaty entry) in a Standard for
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