Oracle Java Foundations 1z0-811 Question # 10 Topic 2 Discussion

Oracle Java Foundations 1z0-811 Question # 10 Topic 2 Discussion

1z0-811 Exam Topic 2 Question 10 Discussion:
Question #: 10
Topic #: 2

Given the code fragment:

1z0-811 Question 10

Which for loop statement can be used to print 135?


A.

for(int idx = 1; idx < arr.length; idx+=2) {

System.out.print (arr[idx]);

}


B.

for(int idx = 1; idx < arr.length–1; idx++) {

System.out.print (arr[idx++]);

}


C.

for(int idx = 0; idx < arr.length; idx++) {

System.out.print (arr[idx]);

}


D.

for(int idx = 0; idx < arr.length; idx+=2) {

System.out.print (arr[idx]);

}


Get Premium 1z0-811 Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.