Home » JAVA Programming » Multithreading » Question
  1. What is the output of this program?
    class newthread implements Runnable 
    {
    Thread thread;
    newthread()
    {
    thread = new Thread(this,"My Thread created...");
    thread.start();
    }
    public void run()
    {
    System.out.println(thread.getName());
    }
    }
    public class multithreaded_Example
    {
    public static void main(String args[])
    {
    new newthread();
    }
    }
    1. My Thread created...
    2. My Thread
    3. Thread created...
    4. New Thread
    5. None of these
Correct Option: A

My Thread created...



Your comments will be displayed only after manual approval.