-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest6.java
More file actions
34 lines (26 loc) · 815 Bytes
/
Copy pathTest6.java
File metadata and controls
34 lines (26 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// single and multiple task using single and multiple thread
// performing single task using single thread
// public class Test6 extends Thread{
// public void run(){
// System.out.println("Running");
// }
// public static void main(String[] args) {
// Test6 t = new Test6();
// t.start();
// }
// }
// performing single task using multiple thread
public class Test6 extends Thread{
public void run(){
System.out.println("Running one");
}
public static void main(String[] args) {
Test6 t1 = new Test6();
Test6 t2 = new Test6();
Test6 t3 = new Test6();
t1.start();
t2.start();
t3.start();
}
}
// multiple task using single threadclass Test6 extends Thread=> Does not exist this type of situation