Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MultithreadDemo {
- public static void main(String[] args) {
- for (int i = 0; i < 10; i++) {
- Task task = new Task();
- task.start();
- }
- }
- }
- class Task extends Thread {
- public void run() {
- System.out.println("Thread: " + Thread.currentThread().getId() + " is running");
- }
- }
Add Comment
Please, Sign In to add comment