-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram9.java
More file actions
31 lines (30 loc) · 839 Bytes
/
Copy pathProgram9.java
File metadata and controls
31 lines (30 loc) · 839 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
class first extends Thread {
public void run() {
for(int i=0;i<10;i++){
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
System.out.println(e);
}
System.out.println("This is first Thread:\n'BMS COLLEGE OF ENGINNERING'");
}
}
}
class second extends Thread {
public void run() {
for (int j = 0; j < 10; j++) {
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
System.out.println(e);
}
System.out.println("This is second thread:\n'CSE'");
}
}
}
public class Program9 {
public static void main(String[] args){
new first().start();
new second().start();
}
}