增强for循环

public class LinkedlistDome {

    public static void main(String[] args) {

    fun();

}

    public static void fun(){

          //创建多态集合
            Collection<String >co=new ArrayList<String>();

t          //添加字符串
              co.add("d");
              co.add("f");
              co.add("e");

        //使用增强for循环遍历
              for(String i:co){
                  System.out.println(i);
              }
    }

}

原文地址:https://www.cnblogs.com/hph1728390/p/10571182.html