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 invokes a thread?s run() method?
How are the elements of a cardlayout organized?
Explain what is orm?
how we can implement interface in jsp ?
Name the class that is used to bind the server object with RMI Registry?
Does Java pass arguments by value or reference?
How to get an image from db2 database plz help as soon as possible
When a thread blocks on i/o?
what is difference between object state and behaviour?
When a thread terminates its processing, it enters into what state?
What is RPC?
What is glasgow?