fork download
  1. using System;
  2. using System.Threading;
  3. class DataPro
  4. {
  5. public void MyPro1()
  6. {
  7. for(int i=0;i<5;i++)
  8. {
  9. System.Console.Write(i);
  10. }
  11. }
  12. public void MyPro2()
  13. {
  14. for(int j=0;j<5;j++)
  15. {
  16. System.Console.Write(j);
  17. }
  18. }
  19. }
  20. class DemoPro
  21. {
  22. static void Main()
  23. {
  24. DataPro d1 = new DataPro();
  25. Thread t1 = new Thread(d1.MyPro1);
  26. Thread t2 = new Thread(d1.MyPro2);
  27. t1.Start();
  28. t2.Start();
  29. }
  30. }
Success #stdin #stdout 0.04s 39136KB
stdin
Standard input is empty
stdout
0123401234