Can a thread be a member of another thread?

Answers were Sorted based on User's Feedback



Can a thread be a member of another thread?..

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

Can a thread be a member of another thread?..

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

Post New Answer

More Advanced Java Interview Questions

What is the lifecycle of an applet?

2 Answers  


Explain the different types of memory used by jvm?

0 Answers  


Define prototype?

0 Answers  


Explain ioc concept?

0 Answers  


Which container method is used to cause a container to be laid out and redisplayed?

0 Answers  






Brief description about local interfaces?

0 Answers  


whats is mean by jndi

4 Answers   SolutionNET,


Suppose there are 3 combo box. SELECT COUNTRY SELECT STATE SELECT CITY if i select any country from country conutrylistbox values in the state will get automatically inserted with database values>> THEN on selection of state city will be inserted in city combo box If you can help then please Help me...

2 Answers   HCL,


Is the session factory thread safe?

0 Answers  


What are the different types of exception?

0 Answers  


What is the difference between a stub and a skeleton?

9 Answers   ABC, College School Exams Tests, Geoservices, Polaris, Qualcomm, Rajiv Gandhi College of Engineering and Technology RGCET, UTIITSL, Wipro,


What is difference RMI registry and OSAgent?

1 Answers  


Categories