i am learning java. in multithreading i want to put a thread to wait() and then call back it by notify() .. but i am not able to do so. can any one explain it to me by simple example..
Hi guys..problem with using notify() & wait()
Collapse
X
-
HiOriginally posted by Lateefi am learning java. in multithreading i want to put a thread to wait() and then call back it by notify() .. but i am not able to do so. can any one explain it to me by simple example..
I gives you a brief idea for writing Multi Threading Program.
1. Declare a class as extending the thread class.
Ex. class classname extends Thread
{
}
java.lang.threa d is a superclass for the multiple thraeding.
2. overriding the the run method
Ex public void run()
{
}
3. create the object of main class and call start method to.
Ex. new P().start();Comment
-
That is considered bad practice: better implement the Runnable interface andOriginally posted by praveen2guptaHi
I gives you a brief idea for writing Multi Threading Program.
1. Declare a class as extending the thread class.
feed that to a Thread object itself. If you extend from the Thread class you can't
extend from another class anymore and closely ties your implementation to
the Thread class just for utility purposes; don't do that.
kind regards,
JosComment
Comment