5 years ago in Java Multithreading

What is the priority of the thread in output of this program?

class multithreaded_programing {
public static void main(String args[]) {
Thread t = Thread.currentThread();
t.setName("New Thread");
System.out.println(t.getName());
}
}

[A] main
[B] Thread
[C] New Thread
[D] Thread[New Thread,5,main]
Loading...
Next Question

Overall Stats

Attempted 245
Correct 90
Incorrect 58
Viewed 97

Answers

Guest
Guest
Sagar Gawari
Sagar Gawari - 3 weeks ago

Sagar Gawari from Pune, India is saying Thread[New Thread,5,main] is correct answer

Vaibhav Bisht
Vaibhav Bisht - 1 month ago

Vaibhav Bisht from Dehradun, India is saying Thread[New Thread,5,main] is correct answer

Aashi Garg
Aashi Garg - 1 month ago

Aashi Garg from Greater Noida, India is saying Thread[New Thread,5,main] is correct answer

Hareem Malik
Hareem Malik - 2 months ago

Hareem Malik is saying Thread[New Thread,5,main] is correct answer

zainb ryad
zainb ryad - 2 months ago

zainb ryad from Jenin, Palestine is saying New Thread is correct answer

Related Questions

Thread priority in Java is?

  • [A] Integer
  • [B] Float
  • [C] double
  • [D] long

What will happen if two thread of same priority are called to be processed simultaneously?

  • [A] Any one will be executed first lexographically
  • [B] Both of them will be executed simultaneously
  • [C] None of them will be executed
  • [D] It is dependent on the operating system.