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 use of set in java?
How do you find the maximum number from an array without comparing and sorting?
What is time complexity algorithm?
Explain the importance of import keyword in java?
Can a singleton class be inherited?
Why set do not allow duplicates in java?
How do you create a bulleted list?
Define how objects are stored in java?
What are the different access modifiers available in java?
What are the differences between string, stringbuffer and stringbuilder?
What is JDBC Driver interface?How can you retrieve data from the ResultSet
Discuss 2D arrays.
What is array length?
What does .equals do in java?
How do you square a number?