forked from dangtuanhuy/Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPriorityThread.java
More file actions
28 lines (26 loc) · 783 Bytes
/
Copy pathPriorityThread.java
File metadata and controls
28 lines (26 loc) · 783 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
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Session7_PriorityThread;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author lhhuong
*/
public class PriorityThread extends Thread {
@Override
public void run(){
System.out.println("");
for (int i = 1; i <= 100; i++) {
System.out.println(i+" Thread name: "+Thread.currentThread().getName());
try {
Thread.sleep(1000);
} catch (InterruptedException ex) {
Logger.getLogger(PriorityThread.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
}