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 |
When a thread blocks on i/o, what state does it enter?
How has the sandbox changed with Java 2?
the advantages of polymorphic
In connection pool,when 100 clients are requesting, in pool 100 objects is there, when another client is making request how it will work
whats is mean by class.forName() whats the return type of class
A user of a web application sees a jsessionid argument in the URL whenever a resource is accessed. What does this mean? a. The form must have the field jsessionid b. URL rewriting is used as the session method c. Cookies are used for managing sessions
whats is mean by class.forName() whats the return type of class
Explain the stub's and skeleton's functionality?
On a computer that having single CPU, how multithreading concept can be achieved?
What is the need of serialize?
iam writing the contents to a excel through I/O i am putting first statement as WRITE and then READ(from excel) immediately..later user complains that he is not getting the date by using READ ..wat could be the situation
Difference between loadclass and class.forname?