标签:
1 import java.util.*; 2 3 public class EnhancedFor { 4 public static void main(String[] args) { 5 int[] arr = {1, 2, 3, 4, 5}; 6 for(int i : arr) { 7 System.out.println(i); 8 } 9 10 Collection c = new ArrayList(); 11 c.add(new String("aaa")); 12 c.add(new String("bbb")); 13 c.add(new String("ccc")); 14 for(Object o : c) { 15 System.out.println(o); 16 } 17 } 18 }
标签:
原文地址:http://www.cnblogs.com/roger-h/p/4489011.html