import java.util.concurrent.*; public class TestCallable { public static void main(String[] args) throws Exception { MyCallable callable = new MyCallable(); FutureTask future = new FutureTask<>(callable); Thread thread = new Thread(future); thread.start(); System.out.println(future.get()); } } class MyCallable implements Callable { @Override public String call() { try { Thread.sleep(1000); } catch (Exception e) { e.printStackTrace(); } return "Finished."; } }