Multiple Choice
Assume array items contains the integer values 0,2,4,6 and 8.Which of the following set of statements uses the enhanced for loop to display each value in array items?
A) for ( int i = 0;i < items.length;i++ ) System.out.prinf( "%d\n",items[ i ] ) ;
B) for ( int i : items ) System.out.prinf( "%d\n",items[ i ] ) ;
C) for ( int i : items ) System.out.prinf( "%d\n",i ) ;
D) for ( int i = 0 : items.length ) System.out.prinf( "%d\n",items[ i ] ) ;
Correct Answer:

Verified
Correct Answer:
Verified
Q2: Which of the following statements creates a
Q13: Constant variables also are called .<br>A) write-only
Q14: Which of the following statements is false?<br>A)
Q17: Consider integer array values,which contains 5 elements.Which
Q18: Which of the following statements about an
Q21: Attempting to access an array element out
Q22: An array with m rows and n
Q23: Which of the following will not produce
Q24: Class Arrays provides method _ for comparing
Q28: In Java,multidimensional arrays _.<br>A)are not directly supported.<br>B)are