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
На этой странице сайта вы можете посмотреть видео онлайн Multithreading Methods In Java | getPriority | setPriority | getId | currrentThread @Technical Icode длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Technical Icode 22 Октябрь 2023, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 44 раз и оно понравилось 2 зрителям. Приятного просмотра!