Solved

Assume Array Items Contains the Integer Values 0,2,4,6 and 8

Question 19

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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions