Solved

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

Question 42

Multiple Choice

Assume array items contains the integer values 0,2,4,6 and 8.Which of the following 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