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. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone extends Thread
  9. {
  10. public void run()
  11. {
  12. for(int i=1;i<5;++i)
  13. {
  14. try { Thread.sleep(500);}catch(InterruptedExecution i){System.out.println(i);}
  15. System.out.println(i);
  16. }
  17. }
  18. public static void main (String[] args) throws java.lang.Exception
  19. {
  20. // your code goes here
  21. Ideone i1= new Ideone();
  22. Ideone i2= new Ideone();
  23. i1.start();
  24. i2.start();
  25. }
  26. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:14: error: cannot find symbol
			try { Thread.sleep(500);}catch(InterruptedExecution i){System.out.println(i);}
			                               ^
  symbol:   class InterruptedExecution
  location: class Ideone
Main.java:14: error: variable i is already defined in method run()
			try { Thread.sleep(500);}catch(InterruptedExecution i){System.out.println(i);}
			                                                    ^
2 errors
stdout
Standard output is empty