GeekInterview.com
Series: Subject: Topic:
Question: 431 of 1118

How to kill a thread?

This question is related to Oracle Interview
Asked by: Interview Candidate | Asked on: Sep 28th, 2004
Showing Answers 1 - 1 of 1 Answers
Sandhya.Kishan

Answered On : Jun 19th, 2012

View all answers by Sandhya.Kishan

The Thread.stop() method can be used to kill a thread but it is unsafe and thus deprecated.
Other way would be to have a variable indicating if the thread should be stopped. Other threads may set the variable to make the thread stop. Then, the thread itself may clean up and stop.

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.