Which two statements are true?

Given the code fragment:
int[] array = {I, 2, 3, 4, 5};
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?
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.

Download Printable PDF. VALID exam to help you PASS.

3 thoughts on “Which two statements are true?

  1. // Process alternating elements of the array:

    for(int i=0; i<array.length; i+=2) {
    System.out.println(array[i]); }

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.