for语句增强

时间:2021-04-15 12:23:41   收藏:0   阅读:0
package ShunXuDome;

public class forDOme05 {
public static void main(String[] args) {
int[]numbers={10,20,30,40,50};//定义了一个数组
for (int i = 0; i < 5; i++) {
System.out.println(numbers[i]);

}
//遍历组的元素
for(int x:numbers){
System.out.println(x);
}
}
}
评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!