Skip to content

Commit 7852cba

Browse files
Create PriorityMain.java
1 parent 69ebde0 commit 7852cba

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Thread/PriorityMain.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
class PriorityMain extends Thread
2+
{
3+
public void run()
4+
{
5+
System.out.println("The current thread name is: " + Thread.currentThread().getName());
6+
}
7+
public static void main(String args[])
8+
{
9+
PriorityMain th1 = new PriorityMain();
10+
PriorityMain th2 = new PriorityMain();
11+
PriorityMain th3 = new PriorityMain();
12+
th1.setPriority(MIN_PRIORITY);
13+
th2.setPriority(NORM_PRIORITY);
14+
th3.setPriority(MAX_PRIORITY);
15+
th1.start();
16+
th2.start();
17+
th3.start();
18+
}
19+
}

0 commit comments

Comments
 (0)