效率方面有区别吗
int[] numbers = {1,2,3,4,5,6,7,8,9,10};
for (int item : numbers) {
System.out.println("Count is: " + item);
}
和
int[] numbers = {1,2,3,4,5,6,7,8,9,10};
for (int i = 0; i < 10; i++) {
System.out.println("Count is: " + numbers[i]);
}