Guest User

Untitled

a guest
May 22nd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. public class MultithreadDemo {
  2. public static void main(String[] args) {
  3. for (int i = 0; i < 10; i++) {
  4. Task task = new Task();
  5. task.start();
  6. }
  7. }
  8. }
  9.  
  10. class Task extends Thread {
  11. public void run() {
  12. System.out.println("Thread: " + Thread.currentThread().getId() + " is running");
  13. }
  14. }
Add Comment
Please, Sign In to add comment