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 |
Explain phantom read?
What is local interface. How values will be passed?
What is UniCastRemoteObject and what is its use in RMI?
What is the difference between the font and fontmetrics classes?
Which containers use a border layout as their default layout?
why static class in java
What are the high-level thread states?
how i secure my site with the https protocol.what are the steps?
How task's priority is used in scheduling?
In our urls and in the text of the buttons we have comma. Its causing an error. Is there a way to change the delimiting character for the menu arguments?
Why doesn’t the focus feature on the tag work in every circumstance?
Connection Pooling with different type of databases?