java数组:for-each循环
语法
for(元素类型 元素变量:要遍历的对象){
循环语句;
}
for each循环执行次数取决于遍历的对象元素个数
package cn.xtnotes.u6;
public class T4 {
public static void main(String[] args) {
double[] a= {6.55,5.66,9.51,6.88};
for (double x:a) {
System.out.println(x);
}
}
}
输出:
6.55
5.66
9.51
6.88
阅读剩余
版权声明:
作者:Tin
链接:http://www.tinstu.com/94.html
文章版权归作者所有,未经允许请勿转载。
THE END