Topic: [请教]java线程问题

  Print this page

1.[请教]java线程问题 Copy to clipboard
Posted by: dodoflying
Posted on: 2004-06-17 16:03

请问以下代码

public class MyThread extends Thread {
  public void run() {
    System.out.println("I am here");
    suspend();
    resume();
    System.out.println("Are you too?");
  }

  public static void main(String args[]) {
    (new MyThread()).start();
  }

}

执行结果为何是
I am here
为何
resume();
没有得到执行呢?

2.Re:[请教]java线程问题 [Re: dodoflying] Copy to clipboard
Posted by: JackLou
Posted on: 2004-06-18 10:15

问题应该是这里:

suspend();
resuem();

已经挂起了,自己还可以唤起自己吗?


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923