- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChapter55.java
More file actions
Latest commit
20 lines (17 loc) · 593 Bytes
/
Copy pathChapter55.java
File metadata and controls
20 lines (17 loc) · 593 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
packagechapter55;
importjava.io.IOException;
publicclassThreadEx1 {
publicstaticvoidmain(String[] args) {
try {
//메모장 실행
Processp1 = Runtime.getRuntime().exec("notepad.exe");
//그림파 실행
Processp2 = Runtime.getRuntime().exec("mspaint.exe");
p1.waitFor();//p1 프로세서가 종료될때 까지 대기
p2.destroy();//p1 프로세서가 종료되면 실행
} catch (Exceptione) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}