Can a thread be a member of another thread?
Answers were Sorted based on User's Feedback
Answer / s.ramesh
import java.util.*;
public class DemoThread extends Thread {
private Thread t = null;
public DemoThread() {
t= new Thread(this, "RacingThread");
t.start();
}
public static void main(String[] args) {
DemoThread dt = new DemoThread();
dt.setName("DemoThread");
dt.start();
}
public void run()
{
while(true)
{
try
{
this.sleep(5000);
}
catch(Exception e)
{
System.out.println("Exception Occured");
}
}
}
}
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / amalendra
A thread is the smallest executable unit in the system. It
means a thread can start another thread, but it can not be
a member of another thread.
Is This Answer Correct ? | 1 Yes | 1 No |
What are the services in RMI ?
which of the following authentication is stronger than the others? a. Http Basic b. Http DIGEST c. Form based
What is the argument type of a programs main() method?
Explain the purposes of methods wait(), notify(), notifyAll ()?
Is it possible to stop the execution of a method before completion in a sessionbean?
What are synchronized methods and synchronized statements?
What is the difference between long.class and long.type?
When you will synchronize your code?
Why does most servlets extend HttpServlet?
Why do threads block on i/o?
What is metaspace?
In a multitiered application which tier is the browser in?