Subscribe The Channle
@technicalicode
Thread Priority, Thread ID
setPriority()
getPriority()
getid()
currentThread()
class A extends Thread
{
public void run()
{
System.out.println("\n inside Thread A: \nTread ID:\t"+
Thread.currentThread().getid()+"\nThread
Priority:\t"+Thread.currentThread().getPriority());
}
}
class B extends Thread
{
public void run()
{
System.out.println("\n inside Thread B: \nTread ID:\t"+
Thread.currentThread().getid()+"\nThread
Priority:\t"+Thread.currentThread().getPriority());
}
}
class C extends Thread
{
public void run()
{
System.out.println("\n inside Thread C: \nTread ID:\t"+
Thread.currentThread().getid()+"\nThread
Priority:\t"+Thread.currentThread().getPriority());
}
}
class threadid
{
public static void main(String args[])
{
A aa=new A();
B bb=new B();
C cc=new C();
aa.setPriority(Thread.MIN_PRIORITY);
bb.setPriority(Thread.NORM_PRIORITY);
cc.setPriority(Thread.MAX_PRIORITY);
System.out.println("\n inside Main Thread and it's ID is:"
+Thread.currentThread().getid()+"\nMain
Priority="+Thread.currentThread().getPriority());
System.out.println("\n Now calling other threads:
Thread A -Thread B - Thread C");
aa.start();
bb.start();
cc.start();
}
}
#technicalicode
#multithreadingmethods
#getpriority
#setpriority
#multithreadinginjava
#multithreading
#multithread
Nesta página do site você pode assistir ao vídeo on-line Multithreading Methods In Java | getPriority | setPriority | getId | currrentThread @Technical Icode duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Technical Icode 22 Outubro 2023, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 44 vezes e gostou 2 espectadores. Boa visualização!