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 |
Is infobus easy to use?
What are the different methods of identifying an object?
What is the difference between the string and stringbuffer classes?
Why a client should be multithreading? Explain.
diff between jsp include directive and jsp action include?
What is RRL?
How can I avoid validating a form before data is entered?
Difference between hashmap and hashtable?
What is private static final long serialVersionUID = 1L;
diff between jsp include directive and jsp action include?
difference between Abstract and Interface?
Can you control when passivation occurs?