first commit

This commit is contained in:
2026-01-29 14:05:10 +05:30
commit 00b45c11a4
14 changed files with 137 additions and 0 deletions

15
TestMultiPriority1.java Normal file
View File

@@ -0,0 +1,15 @@
// 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(2);
m2.setPriority(Thread.MAX_PRIORITY);
m1.start();
m2.start();
}
}