java中的foreach输出数组中的元素

public class forEach {
public static void main(String[]args){
String [] hobby = {"imooc","telephone","zhangjie"};
for(int i = 0;i < hobby.length;i++){
System.out.println(hobby[i]);
}

for(String zhangyi : hobby){
System.out.println(zhangyi);
}
}
}

上一篇:1043: [HAOI2008]下落的圆盘


下一篇:AVERAGE和averageif函数