Suppose you want to use a for loop to iterate through an array named anArray. How would you indicate the number of times the loop will be performed?

A. final Integer N = anArray.length;
for (Integer i = 0; i < N; i++) {...
B. anArray.length = N;
for (Integer i = 0; i < anArray.length; i++) {...
C. for (anArray.length = 0; anArray.length < N; anArray.length++) {...
D. final Integer N = anArray.length;
for (Integer i = anArray.length; i < N; i++) {...

Answer: A

Computer Science & Information Technology

You might also like to view...

Social networking is only as hazardous or as safe as the individual user makes it

Indicate whether the statement is true or false

Computer Science & Information Technology

________ is the keyboard shortcut used to copy text or an object

A) [Ctrl] + [C] B) [Ctrl] + [P] C) [Ctrl] + [V] D) [Ctrl] + [X]

Computer Science & Information Technology