class B{
A a = new A(c1);
}
class A{
private String c;
public A(String c1){
this.c = c1;}
public void createThread(){
new D().start();}
public void notifyThread(){
notifyAll();//唤醒线程
}
}
class D extends Thread{
public void run(){
while(true){
wait();
if(...)//判断条件里含方法,取A中的变量c;如果满足则继续
{ }else{continue;}//否则返回while去wait();
}
}
}
我的意思就是线程D中的方法如何写?