- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththread_methods.java
More file actions
Latest commit
33 lines (29 loc) · 678 Bytes
/
Copy paththread_methods.java
File metadata and controls
33 lines (29 loc) · 678 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
classMyNewThr1extendsThread{
publicvoidrun(){
inti = 0;
while(true){
System.out.println("Thank you: ");
try {
Thread.sleep(455);
} catch (InterruptedExceptione) {
e.printStackTrace();
}
i++;
}
}
}
classMyNewThr2extendsThread{
publicvoidrun(){
while(true){
System.out.println("My Thank you: ");
}
}
}
publicclassthread_methods {
publicstaticvoidmain(String[] args){
MyNewThr1t1 = newMyNewThr1();
MyNewThr2t2 = newMyNewThr2();
t1.start();
t2.start();
}
}