Multithreading in Java
Multithreading in Java
The thread is in
runnable state after
invocation of start()
method, but the thread
scheduler has not
selected it to be the
running thread.
Life cycle of a thread
class TestMultiPriority1 extends Thread{ TestMultiPriority1 m2=new TestMultiPriority1();
public void run(){
System.out.println("running thread name is:"+Th m1.setPriority(Thread.MIN_PRIORITY);
read.currentThread().getName()); m2.setPriority(Thread.MAX_PRIORITY);
System.out.println("running thread priority is:"+ m1.start();
Thread.currentThread().getPriority());
m2.start();
}
}
public static void main(String args[]){ }
TestMultiPriority1 m1=new TestMultiPriority1();