Home » JAVA Programming » Multithreading » Question
  1. What is the output of this program?
    class Mythread extends Thread 
    {
    Mythread()
    {
    super("New Thread...");
    start();
    }
    public void run()
    {
    System.out.println(this);
    }
    }

    public class multithreaded_programing
    {
    public static void main(String args[])
    {
    new Mythread();
    }
    }
    1. New Thread...
    2. [New Thread...,5,main]
    3. Thread[New Thread...,5,main]
    4. Thread
    5. None of these
Correct Option: C

Although we have not created any object of thread class still we can make a thread pointing to main method, we can refer it by using this.



Your comments will be displayed only after manual approval.