【发布时间】:2011-12-06 15:59:41
【问题描述】:
我不是 java 人,但我继承了一些需要修补的代码。我将源代码拉入netbeans,但出现错误:匿名类实现接口;不能有参数。
代码如下:
Executor background = Executors.newSingleThreadExecutor();
Runnable mylookupThread = new Runnable(FilePath, SearchIndex)
{
public void run()
{ MainWindow.this.processFile(this.val$FilePath);
Thread t = new Thread(new lookupThread(MainWindow.arrFile, true, false, this.val$SearchIndex));
t.setName("Lookup");
t.setPriority(10);
t.start();
}
};
background.execute(mylookupThread);
Executor statusThread = Executors.newSingleThreadExecutor();
Runnable myStatusThread = new Runnable()
{
public void run()
{ MainWindow.this.updateStatus();
}
};
statusThread.execute(myStatusThread);
错误出现在第二行。救命?!?
【问题讨论】:
标签: java class interface anonymous