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]);
}
c.
for (int i : items) {
System.out.prinf("%d%n", i);
}
Computer Science & Information Technology
You might also like to view...
Excel does not provide a spelling checker
Indicate whether the statement is true or false
Computer Science & Information Technology
The ____________ method can be used to convert a string to a decimal.
a. decimal.ToString b. Parse.decimal c. ToString.decimal d. decimal.Parse
Computer Science & Information Technology