5 years ago in Java Multithreading

What is the output of this program?

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

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

Overall Stats

Attempted 268
Correct 44
Incorrect 105
Viewed 119


Sagar Gawari
Sagar Gawari - 3 weeks ago

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

Vaibhav Bisht
Vaibhav Bisht - 4 weeks ago

Vaibhav Bisht from Dehradun, India is saying 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] is correct answer

Poorna Hari priya Muttamsetty
Poorna Hari priya Muttamsetty - 2 months ago

Poorna Hari priya Muttamsetty from Vijayawada, India is saying Thread[New Thread,5,main] is correct answer

rayapudi saiteja
rayapudi saiteja - 3 months ago

rayapudi saiteja from Visakhapatnam, India is saying Thread[main,5,main] is correct answer

Related Questions

Thread priority in Java is?

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

Which of these class is used to make a thread?

  • [A] String
  • [B] System
  • [C] Thread
  • [D] Runnable

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.