java 简单线程实例

Thread thread = new Thread() {

   public void run() {

    for (int i = 0; i < 10; i++) {

     System.out.println(i);

//     try {
//
////      Thread.sleep(800);
//
//     } catch (InterruptedException e) {
//
//     }

    }

    // 当任务执行完毕后调用flex显示对应信息

    ServiceTest.this.fireEvent("Task Finish");
    System.out.println("aa");

   }

  };
  System.out.println("a");
  thread.start();

你可能感兴趣的:(java 简单线程实例)