fork download
  1.  
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. ArrayList<Integer> fizz = new ArrayList<>();
  13. for(int j=0; j<11; j++){
  14. fizz.add(j);
  15. }
  16.  
  17. System.out.println(fizz);
  18. for(int j=0; j<fizz.size(); j++)
  19. {
  20. if(fizz.get(j)>=5 && fizz.get(j)<=7)
  21. {
  22. fizz.remove(j);
  23. j--;
  24. }
  25. }
  26. System.out.println(fizz);
  27. }
  28. }
Success #stdin #stdout 0.06s 32336KB
stdin
Standard input is empty
stdout
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
[0, 1, 2, 3, 4, 8, 9, 10]