javascript
Brief description  about Online courses   join in Online courses
View Anjali  Chitravel 's Profile

sync by runnable interface

can anyone please explain this assignment Please modify the assignment in chapter 4 to synchronize the threads using Synchronized Methods.I am really stuck. Please help.
Asked by Anjali Chitravel | Sep 20, 2017 |  Reply now
Replies (1)
View arun kumar das 's Profile
Anjali,

Question has to rectify i.e. it's not in chapter 4, You can take any String type array and using thread concept call the synchronized() method like

public synchronized void run()
{
ThreadExample.displaylist(Name,msg);
}

and also

public static synchronized void displaylist(String n,String list[])
{
// code to call the methods
}

Check this out.
Sep 25, 2017