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 |
Why use POJO when I can use hashmap
What is the difference between RMI registry and OS Agent?
What are callback interfaces?
Where does the session Object stores? If 100 users are connecting to the server. How does it recognize which session belongs to which user?
5 Answers HCL, Mobillo Venture,
hi friends, i have done my BE(CSE)at 2011 then i have joined one company before they asked me 50k so i paid but now they telling no project here so we r going to close like that so now i need any job i have good knowledge in core java and j2ee(jsp,servlet,jdbc) so if u know any job pl help me
why static class in java
Differences between applications and applets?
Can we sent objects using Sockets?
Can I use javascript to submit a form?
What is the immediate superclass of the applet class?
What is the difference between a menuitem and a checkboxmenuitem?
Why use a datasource when you can directly specify a connection details?