-
What is the priority of the thread in output of this program?
public class multithreading_Priority
{
public static void main(String args[])
{
Thread thread = Thread.currentThread();
System.out.println(thread);
}
}
-
- 0
- 1
- 2
- 4
- 5
Correct Option: E
The output of program is Thread[main,5,main], in this priority assigned to the thread is 5. It’s the default value. Since we have not named the thread they are named by the group to they belong i:e main method.