我有一个类型为Iterable<BufferedImage> imageList 的变量,但不知道怎么初始化,不知道如何用add(..)
谢谢

解决方案 »

  1.   

    这不就是泛型吗?查查就知道怎么用了。google
      

  2.   

    Iterable <BufferedImage> imageList = new <BufferedImage> imageList(); 
      

  3.   

    这个只能用于迭代出其中的数据,不能进行 add。或者说内部的东西是只读的,并不能更改。
      

  4.   

    因为 Collection 接口实现了 Iterable 接口,因此所有实现 Collection 接口的类对象都能对其进行赋值。