public class Foreach {
public static void main(String[] args){
double array0 [] = {0.1,0.2,0.3,0.4,0.5};
//每次都是从0开始依次遍历
for(double i:array0)
System.out.print(i+" ");
}
}
非常简单的一个for-each循环例子
最新推荐文章于 2023-08-15 21:22:09 发布
public class Foreach {
public static void main(String[] args){
double array0 [] = {0.1,0.2,0.3,0.4,0.5};
//每次都是从0开始依次遍历
for(double i:array0)
System.out.print(i+" ");
}
}