fork download
  1. class ABC extends Thread{
  2.  
  3. public static void main(String[] args) {
  4. Thread t1 = new Thread("T1");
  5. Thread t2 = new Thread("T2");
  6. try {
  7. t1.join();
  8. t2.join();
  9. } catch (InterruptedException e) {
  10. System.out.println("Main Thread interrupted.");
  11. }
  12. }
  13.  
  14. public void run(){
  15. System.out.println("Run executed");
  16. }
  17. }
Success #stdin #stdout 0.07s 2841600KB
stdin
Standard input is empty
stdout
Standard output is empty