-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestClass.java
More file actions
35 lines (34 loc) · 1.01 KB
/
TestClass.java
File metadata and controls
35 lines (34 loc) · 1.01 KB
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
35
class MyThreadQues2 implements Runnable {
public void run() {
for(int a=0; a<100; a++){
System.out.println("Creating thread using the implement runnable method 1.");
}
}
}
class MyThreadQues2part1 implements Runnable {
public void run() {
for(int a=0; a<100; a++){
System.out.println("Creating thread using the implement runnable method 2.");
}
}
}
class MyThreadQues2part2 implements Runnable {
public void run() {
for(int a=0; a<100; a++){
System.out.println("Creating thread using the implement runnable method part 3.");
}
}
}
public class TestClass {
public static void main ( String[] args ) {
MyThreadQues2 NewInstance = new MyThreadQues2();
MyThreadQues2part1 NewInstancepart1 = new MyThreadQues2part1();
MyThreadQues2part2 NewInstancepart2 = new MyThreadQues2part2();
Thread NewThreadName = new Thread(NewInstance);
Thread NewThreadNamepart1 = new Thread(NewInstancepart1);
Thread NewThreadNamepart2 = new Thread(NewInstancepart2);
NewThreadName.start();
NewThreadNamepart1.start();
NewThreadNamepart2.start();
}
}