for each

public class ArrayForeach{
   public static void main(String []args){
   int [][]a={{1,2,3},{4,5,6},{7,8,9},{10,11,12}}  ;
   for(int []row:a)
   {
   for(int element:row)
   System.out.println(element);
   }
   }

}

posted @ 2014-09-14 15:30  fantasy12436109  阅读(124)  评论(0编辑  收藏  举报