JavaGian java tutorial and java interview question and answer

JavaGian , Free Online Tutorials, JavaGian provides tutorials and interview questions of all technology like java tutorial, android, java frameworks, javascript, ajax, core java, sql, python, php, c language etc. for beginners and professionals.

Showing posts with label Thread Control. Show all posts
Showing posts with label Thread Control. Show all posts

Java Thread Control

10:09 PM
Core Java provides complete control over multithreaded program. You can develop a multithreaded program which can be suspended, resumed, or stopped completely based on your requirements. There are various static methods which you can use on thread objects to control their behavior. Following table lists down those methods − Sr.No. Method & Description 1 public void suspend() This method puts a thread in the suspended state and can be resumed using resume() method. 2 public void stop() This method stops a thread completely. 3 public void resume() This method resumes a thread, which was suspended using suspend() method. 4 public void wait() Causes the current thread to wait until another thread invokes the notify(). 5 public void notify() Wakes up a single thread that is waiting on this object's monitor. Be aware that the latest versions of Java has deprecated the usage of suspend( ), resume( ), and stop( ) methods and so you need to use available ...

.