πŸ“Š JAVA
Q. What will be the output of the following Java program?
class newthread implements Runnable
{
Thread t;
newthread()
{
t = new Thread(this,"My Thread");
t.start();
}
public void run()
{
System.out.println(t.getName());
}
}
class multithreaded_programing
{
public static void main(String args[])
{
new newthread();
}
}
  • (A) My Thread
  • (B) Thread[My Thread,5,main]
  • (C) Compilation Error
  • (D) Runtime Error
πŸ’¬ Discuss
βœ… Correct Answer: (A) My Thread

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
105
Total Visits
πŸ“½οΈ
12 mo ago
Published
πŸŽ–οΈ
Vijay Sangwan
Publisher
πŸ“ˆ
88%
Success Rate