What is stop(), suspend(), resume() method?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / ravikiran
stop(),suspend() resume() methods are deprecated used for
inter thread communication
stop will stop the exceution of thread
suspend will temporarily suspends the thread execution
resume will invoke the suspended threads for execution
| Is This Answer Correct ? | 46 Yes | 3 No |
Answer / mohammed salim
stop(), suspend(), resume() methods are deprecated in the
jdk1.2
| Is This Answer Correct ? | 17 Yes | 14 No |
Why java applets are more useful for intranets as compared to internet?
What is the purpose of setAutoCommit() ?
How do you compare values in java?
Where to store local variables?
Is assembly language a low level language?
How to validate the request (Eg:user name and password) in session(http session)? not in LDAP server ?
Catch(Exception e){ } in that what is Exception and purpose of that in that place exactly?
public class Garbage { int a=0; public void add() { int c=10+20; System.out.println(c); System.out.println(a); } public static void main(String args[]) { Garbage obj=new Garbage(); System.gc(); System.out.println("Garbage Collected"); obj.add(); } } Above is a code in java used for garbage collection. object obj has been created for the class Garbage and system.gc method is called. Then using that object add method is called.System.gc method if called the obj should be garbage collected?
What is string args [] in java?
Adapter classes?
What is hashmap and map?
if two references are having same hash codes,is that means those are refering to same object?