91.
What will be the output of the following Java code?
class newthread extends Thread 
{
Thread t;
newthread()
    {
  t = new Thread(this,"My Thread");
  t.start();
}
public void run()
    {
        try
        {
            t.join()   
      System.out.println(t.getName());
        }
        catch(Exception e)
        {
        System.out.print("Exception");
        }
}
}
class multithreaded_programing
{
    public static void main(String args[])
    {
        new newthread();        
    }
}

92.
What is the priority of the thread in the following Java Program?
class multithreaded_programing 
{
    public static void main(String args[])
    {
        Thread t = Thread.currentThread();
        System.out.println(t);        
    }
}

95.
What is synchronization in reference to a thread?

97.
What is the priority of the thread in output in the following Java program?
class multithreaded_programing
{
    public static void main(String args[])
    {
        Thread t = Thread.currentThread();
        t.setName("New Thread");
        System.out.println(t.getName());        
    }
}

99.
What is the name of the thread in the following Java Program?
class multithreaded_programing
{
    public static void main(String args[])
    {
        Thread t = Thread.currentThread();
        System.out.println(t);        
    }
}

Read More Section(Threads)

Each Section contains maximum 100 MCQs question on Threads. To get more questions visit other sections.