提示:本博客用于自己学习记录
for(a b:c): 将a类型的c中的元素依次赋给b。列:
int arr[] = new int[] {2,9,8,7};
for(int a:arr) {
System.out.println(a);
}
程序的输出结果为:
2 9 8 7

提示:本博客用于自己学习记录
for(a b:c): 将a类型的c中的元素依次赋给b。列:
int arr[] = new int[] {2,9,8,7};
for(int a:arr) {
System.out.println(a);
}
程序的输出结果为:
2 9 8 7