fork download
  1. import java.io.*;
  2. import java.util.*;
  3.  
  4. class Thread1 extends Thread{
  5. void run(){
  6. try {
  7. System.out.println("Thread1 is called...");
  8. } catch(Exception e) {
  9. }
  10. }
  11. }
  12.  
  13. class Thread2 extends Thread{
  14. void run(){
  15. try {
  16. System.out.println("Thread2 is called...");
  17. } catch(Exception e) {
  18. }
  19. }
  20. }
  21.  
  22. class MainThread(){
  23. public static void main (String[] args) {
  24. Thread1 t1 = new Thread1();
  25. Thread2 t2 = new Thread2();
  26. t1.start();
  27. t2.start();
  28. }
  29. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:22: error: '{' expected
class MainThread(){
                ^
1 error
stdout
Standard output is empty