阅读背景:

Java实现异步调用

来源:互联网 

一、创立线程

 @Test
public void test0() throws Exception {
  System.out.println("main函数开端履行");
  Thread thread=new Thread(new Runnable() {
    @Override
    public void run() {
      System.out.println("===task start===");
      try {
        Thread.sleep(5000);
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
      System.out.println("===task finish===");
    }
  });

  thread.start();
  System.out.println("main函数履行停止");

} @Test
public void test0() throws Exceptio



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: