List.iterator() returns a new Iterator every time


        List list = Arrays.asList("a","b", "c");

        System.out.println(list.iterator().next());  // "a"
        System.out.println(list.iterator().next());  // still "a"


Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.