exam questions

Exam 1z0-808 All Questions

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

Exam 1z0-808 topic 1 question 63 discussion

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

Given the code fragment:

And given the requirements:
1. Process all the elements of the array in the order of entry.
2. Process all the elements of the array in the reverse 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 1 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
iSnover
Highly Voted 2 years, 3 months ago
The Correct options are BD. I'm gonna explain: A -> Wrong, because enhanced for cannot read collections in reverse and alternately, it loops through each element and only in an ascending way. B -> Correct, with standard for you can go through elements of a collection in ascending, descending and alternating ways. C -> Wrong, you can loop backwards through an i-- in the third parameter of your for with the correct condition and you can also access collections alternately instead of putting "i++" in the third parameter of the standard for you, you can put the expression "i = i + 2" or any other number you want in place of 2. D -> Correct, an enhanced for processes all elements of an array in input form. E -> Wrong, you can do it alternately with a standard for as I explained in alternative C.
upvoted 8 times
Kolodets
1 year, 8 months ago
Thank You!
upvoted 1 times
...
...
MPignaProTech
Most Recent 3 months ago
Selected Answer: BD
BD are correct
upvoted 1 times
...
somrita90
1 year, 4 months ago
B & D are correct
upvoted 1 times
...
tuyetan
1 year, 7 months ago
B and D
upvoted 1 times
...
magseroooni
1 year, 9 months ago
Selected Answer: BD
B and D
upvoted 1 times
...
Vicky_65
1 year, 9 months ago
Selected Answer: BD
B and Dare correct.
upvoted 1 times
...
akbiyik
2 years, 1 month ago
Answer is BD.
upvoted 1 times
...
morgan3987
2 years, 2 months ago
Correct Answer:B 、D
upvoted 1 times
...
carloswork
2 years, 2 months ago
Selected Answer: BD
Answer is BD.
upvoted 1 times
...
praroopgupta
2 years, 3 months ago
B, D are correct as standard loop can be used for all 3 requirements while enhanced loop can be used only for 1st requirement.
upvoted 4 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