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

Thread[New Thread created...,5,main]



Your comments will be displayed only after manual approval.