ExamVeda
Login
Home
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();        
    }
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
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);        
    }
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
93
Which of these method is used to explicitly set the priority of a thread?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
94
Which of these method waits for the thread to terminate?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
95
What is synchronization in reference to a thread?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
96
What does not prevent JVM from terminating?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
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());        
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
98
Which of these method of Thread class is used to find out the priority given to a thread?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
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);        
    }
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
100
Which function of pre defined class Thread is used to check weather current thread being checked is still running?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board