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);
              }
    }

}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-13
  • 2021-10-04
  • 2021-11-05
  • 2021-07-29
  • 2022-03-03
  • 2022-12-23
猜你喜欢
  • 2021-10-18
  • 2022-12-23
相关资源
相似解决方案