|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
发信人: 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(); |
|