Answer Posted / kruthi
stop(), suspend() and resume() are the methods used for
thread implementation.
stop() - terminate the thread execution,
Once a thread is stopped, it cannot be restarted with the
start() command, since stop() will terminate the execution
of a thread. Instead you can pause the execution of a
thread with the sleep() method. The thread will sleep for a
certain period of time and then begin executing when the
time limit is reached. But, this is not ideal if the thread
needs to be started when a certain event occurs. In this
case, the suspend() method allows a thread to temporarily
cease executing.
resume() method allows the suspended thread to start again.
| Is This Answer Correct ? | 77 Yes | 3 No |
Post New Answer View All Answers
What are three ways in which a thread can enter the waiting state in java programming?
What does 3 dots mean in java?
Write a program to solve producer consumer problem in java?
What is the difference between the size and capacity of a vector?
What is the benefit of abstract class?
List the different types of classloaders in java.
What are the principle concepts of oops?
Give differences between Quicksort &Mergesort. When should these sorts be used andwhat is their running time in java?
What is unicode with example?
What are different types of control structures?
What type of variable is gender?
I am a fresher and know core java, c languge, html, css etc if I am illegible for any job then send it on my email tatranakshay276@gmail.com
What is the structure of java?
What are the java ide’s?
Explain throw keyword in java?