码迷,mamicode.com
首页 > 其他好文 > 详细

for each

时间:2014-11-04 12:54:55      阅读:146      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   ar   for   sp   div   log   bs   

 1 public class Tforeach {
 2 
 3     /**
 4      * @param args
 5      */
 6     public static void main(String[] args) {
 7         // TODO Auto-generated method stub
 8 
 9     
10     String [] s=new String[]{"123","321","456"};
11     for(String i:s){//将数组s的每一个值从s[0]起赋值给 相应类型的 i 循环至遍历
12         System.out.println(i+"\t");
13     }
14         
15 
16 }
17 }

 

for each

标签:style   blog   color   ar   for   sp   div   log   bs   

原文地址:http://www.cnblogs.com/mimimimimi/p/4073079.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!