This commit is contained in:
Misa
2026-02-15 20:45:00 +05:30
commit a6112cfc98
60 changed files with 671 additions and 0 deletions

17
TestMultiPriority1.java Normal file
View File

@@ -0,0 +1,17 @@
//write a java code for demonstrating thread priority
class TestMultiPriority1 extends Thread {
public void run()
{
System.out.println("Running thread name is: " +Thread.currentThread().getName());
System.out.println("Running thread priority is: "+Thread.currentThread().getPriority());
}
public static void main(String[] args)
{
TestMultiPriority1 m1 = new TestMultiPriority1();
TestMultiPriority1 m2 = new TestMultiPriority1();
m1.setPriority(Thread.MIN_PRIORITY);
m2.setPriority(Thread.MAX_PRIORITY);
m1.start();
m2.start();
}
}