fork download
  1. import java.util.*;
  2. class Main {
  3. public static void main (String[] args) {
  4. List<Boolean> l = new ArrayList<Boolean>();
  5. l.add(true);
  6. l.add(true);
  7. l.add(null);
  8. l.add(true);
  9. int c = 0;
  10. for(Iterator<Boolean> it = l.iterator(); it.hasNext();) {
  11. if(it.next()) {
  12. System.out.println(c);
  13. }
  14. c++;
  15. }
  16. }
  17. }
Runtime error #stdin #stdout 0.03s 245632KB
stdin
Standard input is empty
stdout
0
1