BBS水木清华站∶精华区
发信人: KHP (人之初), 信区: Java
标 题: Re: How do thread communicate with each other?
发信站: BBS 水木清华站 (Fri Jul 2 23:29:29 1999)
【 在 networm (网虫) 的大作中提到: 】
∶ Class ParentThread extends Thread {
∶ .....
∶ main()
∶ {....
∶ new ChildThread(this).start();
∶ ...
∶ }
∶ Compile Error: this can't be used in the static method.
∶ why.????
别 why 了,错误信息不是说得很清楚吗?
可以这样:
ParentThread pthread = new ParentThread();
(new ChildThread(pthread)).start();
--
※ 来源:·BBS 水木清华站 bbs.net.tsinghua.edu.cn·[FROM: 166.111.163.77]
BBS水木清华站∶精华区