fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7.  
  8. /* Name of the class has to be "Main" only if the class is public. */
  9. public final class Main {
  10. final static class Main$ {
  11. private static final int x;
  12.  
  13. public static final Main$ MODULE$;
  14.  
  15. static {
  16. MODULE$ = new Main$();
  17.  
  18. x = 1;
  19.  
  20. for (int i = 0; i < 10; i++) {
  21. new Thread(MODULE$::run).start();
  22. }
  23.  
  24. System.out.println("Test");
  25. try {
  26. Thread.sleep(1000);
  27. } catch(InterruptedException e) {
  28. throw new RuntimeException(e);
  29. }
  30. System.out.println("Test 2");
  31. }
  32.  
  33. private void run() {
  34. System.out.println(0);
  35. System.out.println(x());
  36. System.out.println(2);
  37. }
  38.  
  39. public int x() {
  40. return x;
  41. }
  42.  
  43. public void main(String[] args) {}
  44.  
  45. }
  46.  
  47. public static void main(String[] args) {
  48. Main$.MODULE$.main(args);
  49. }
  50.  
  51. public static int x() {
  52. return Main$.MODULE$.x();
  53. }
  54. }
  55.  
Success #stdin #stdout 0.07s 84336KB
stdin
Standard input is empty
stdout
Test
0
0
0
0
0
0
0
0
0
0
Test 2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2