how hasnext() works in collection in java

后端 未结 3 1946
囚心锁ツ
囚心锁ツ 2021-02-10 14:10

program:

public class SortedSet1 {

  public static void main(String[] args) {  

    List ac= new ArrayList();

    c.add(ac);
    ac.add(0,\"hai\");
    ac.add         


        
3条回答
  •  面向向阳花
    2021-02-10 14:28

    the point is ac.get(k) doesn't consume any element of the iterator at the contrary of it.next()

提交回复
热议问题