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 is the use of Semaphore?
What is difference RMI registry and OSAgent?
What is UniCastRemoteObject and what is its use in RMI?
iam writing the contents to a excel through I/O i am putting first statement as WRITE and then READ(from excel) immediately..later user complains that he is not getting the date by using READ ..wat could be the situation
What exceptions are thrown by RMI?
What state does a thread enter when it terminates its processing?
If i learn Java, what kind of applications can i create that will help Banking, Retail, Hotel, Logistics industry.
How are commas used in the intialization and iteration parts of a for statement?
Can I run seam with jdk 1.4 and earlier?
What is re-entrant. Is session beans reentrant. Is entity beans reentrant?
whats is mean by connectionpooling
what is the diffrence between banking and insurance domain?