2021
07-09
07-09
Java源码解析之Iterable接口
目录一、写法1?循环二、写法2?foreach循环三、写法3?Iterator四、Iterable五、Iterator这里我们给定一个集合strings一、写法1?循环for(inti=0,len=strings.size();i<len;i++){System.out.println(strings.get(i));}二、写法2?foreach循环for(Stringvar:strings){System.out.println(var);}三、写法3?IteratorIteratoriterator=strings.iterator();while(iterator.hasNext()){System.out.println...
继续阅读 >