package jvm.createthread;

import java.util.concurrent.FutureTask;

public class CreateByFutureTask {
    public static void main(String[] args)
    {
        FutureTask<String> futureTask = new FutureTask<>(() -> "Create by FutureTask");

        new Thread(futureTask).start();

        try {
            System.out.println(futureTask.get());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
