What is stop(), suspend(), resume() method?

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


Please Help Members By Posting Answers For Below Questions

What is bubble sort in java?

612


How many decimal places is a double?

531


What is difference between fileinputstream and filereader in java?

557


how are methods defined?

547


Does java support multiple inheritances?

556






How do you calculate square roots?

570


What is the final variable?

574


What are different ways of object creation in java ?

569


What is the similarity between dynamic binding and linking?

601


What is derived datatype?

623


Can we have multiple catch block for a try block?

584


Can final class have constructor?

494


design an lru cache in java?

542


what are synchronized methods and synchronized statements? : Java thread

577


What is the relationship between clipping and repainting under awt?

606