package Threadspriority;
public class mainclass {
public static void main(String[] args) {
// TODO Auto-generated method stub
Thread t=new thread1();
Runnable r=new thread2();
t.start();
new Thread(r).start();
System.out.println(t.getName());
System.out.println("Priority of the thread by default"+t.getPriority());
t.setPriority(t.MIN_PRIORITY);
System.out.println("Priority of the thread after setting "+t.getPriority());
t.setPriority(t.MAX_PRIORITY);
System.out.println("Priority of the thread after setting "+t.getPriority());
}
}
>>>------------------------------------------------------------------------------------------------------------
No comments:
Post a Comment