GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing raw.githubusercontent.com — raw.githubusercontent.com

package edu.nwpu.zhao.Test; import java.util.concurrent.*; /** * @author:weilongzhao * @time:2021/7/15 16:22 * * 多线程已经有extants Thread 和Runnable 接口,为什么需要Callable 接口 */ class MyThread implements Callable{ @Override public Integer call() throws Exception { System.out.println(Thread.currentThread().getName()+" come in"); TimeUnit.SECONDS.sleep(2); return 1024; } } public class CallableDemo { public static void main(String[] args) throws ExecutionException, InterruptedException { FutureTask futureTask = new FutureTask(new MyThread()); new Thread(futureTask,"AA").start(); System.out.println(Thread.currentThread().getName()+" come in"); System.out.println(futureTask.get()+100); } }
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.