In this blog, we will see Thread Class and its object, we also see setPriority and setName method for setting of thread properties.
Let’s see example and video on Thread Class.
public class Thread2
public static void main(String args)
Thread t = Thread.currentThread(); // Process of creating an object
// Change Name of thread and priority of thread
t.setPriority(10); // 1 to 10
Thread t1 = new Thread();
Thread [main, 5, main]
Thread [Process-1, 10, main]
Thread [Thread-0, 10, main]
Video available on YouTube.
If you have any query on blog example, you can directly comment us or subscribe our website
629total visits,8visits today