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