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 is string and its types?
What is double word?
What is parseint?
What is the difference between yield() and sleep()?
How many classes can any class inherit java?
In java how do we copy objects?
Can singleton class be inherited in java?
Difference between character constant and string constant in java ?
Which are different kinds of source code?
Define reflection.
What is the difference between dom and sax parser in java?
Why is an interface be able to extend more than one interface but a class can’t extend more than one class?
What are the two environment variables that must be set in order to run any java programs?
What is package private scope in java?
How can we make sure main() is the last thread to finish in java program?