fork(1) download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. var actions = new ArrayList<Runnable>();
  10.  
  11. for(var i = new int[]{0};i[0]<3;i[0]++)
  12. {
  13. actions.add(() -> System.out.println(i[0]));
  14. }
  15.  
  16. for (var action : actions)
  17. {
  18. action.run();
  19. }
  20. }
  21. }
Success #stdin #stdout 0.07s 47992KB
stdin
Standard input is empty
stdout
3
3
3