您可以简单地传递
aList给
ProcessList的构造函数,该构造函数可以保留引用,直到需要它为止:
class thisApp { Runnable proExec = new ProcessList (aList); Thread th = new Thread(proExec);}public class ProcessList implements Runnable { private final ArrayList<Character> aList; public ProcessList(ArrayList<Character> aList) { this.aList = aList; } public void run() { }}注意: 如果
aList将由多个线程同时访问,并用一个或多个线程对其进行修改,则所有相关代码都必须为
synchronized。



