fork download
  1. import java.util.*;
  2. import java.lang.*;
  3.  
  4. class Main
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. ArrayList<Integer> foo = new ArrayList<Integer>();
  9. foo.add(1); foo.add(2); foo.add(3);
  10. Iterator<Integer> it = foo.iterator();
  11. System.out.println(it.hasNext());
  12. System.out.println(it.hasNext());
  13. System.out.println(it.hasNext());
  14. System.out.println(it.hasNext());
  15. System.out.println(it.hasNext());
  16. System.out.println(it.hasNext());
  17. }
  18. }
Success #stdin #stdout 0.07s 380160KB
stdin
Standard input is empty
stdout
true
true
true
true
true
true