Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Can a thread be a member of another thread?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of the notify() method?

1138


what are RemoteObjects?

2792


Can I have an action without a form?

1163


whats is statement and procedure

2293


What are JTA/JTS and how they used by client?

2267


Define the remote object implementation?

2569


How would you detect a keypress in a jcombobox?

1188


What is threadfactory?

1155


wahts is mean by dynavalidatorform in struts/

2121


what is the use of State Factories?

2448


What is the diffrence between a local-tx-datasource and a xa-datasource? Can you use transactions in both?

1086


Are we allowed to change the transaction isolation property in middle of a transaction?

1078


In inglish: How to convert jar to exe files? Em português: Como converter arquivos .jar para .exe?

2711


when A client sent a request to the server to open facebook page and close the browser after this request .at that time the same user do login by using a different browser then that session id will exist or not for the same client??

1589


What is a sessionfactory? Is it a thread-safe object?

1265