-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathj57InterpretInThread.java
More file actions
49 lines (41 loc) · 1.29 KB
/
j57InterpretInThread.java
File metadata and controls
49 lines (41 loc) · 1.29 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
class check_thread_exception extends Thread{
public check_thread_exception(String name){
super(name);
}
@Override
public void run(){
// set
while(true){
System.out.println("My Name is : "+this.getName());
try {
// it sleeps 455 time after execution of this thread then after completeion they re execute
Thread.sleep(455);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
class check_thread_exception_basic_thread extends Thread{
public check_thread_exception_basic_thread(String name){
super(name);
}
@Override
public void run(){
// set
int i = 0;
while(i < 20){
System.out.println("Genral other thread");
i++;
}
}
}
public class j57InterpretInThread {
public static void main(String[] args){
check_thread_exception CTE1 = new check_thread_exception("It_Is_Thread_1");
check_thread_exception_basic_thread CTEBT1 = new check_thread_exception_basic_thread("It_Is_Basic_Thread");
// Start Thread
CTEBT1.start();
CTE1.start();
}
}