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 |
we use MainFrame and using os390 for operating system with DB2 data base in IRAN and interest programing with java and use webspere for world wide,please help me where i should start?
how to get value in combo for updation?
What invokes a thread?s run() method?
In howmany ways a thread can be created?
difference between applicationserver and webserver
What are the states associated in the thread?
What is a modular application? What does module-relative mean?
What is aop(assepct oriented programing)?
How many requests can a server fetch at a time?
Is the session factory thread safe?
What if the static modifier is removed from the signature of the main method?
the use of try and ffinally keyword