2015-06-20 172 views

回答

2

不與FutureTask本身,但你可以擴展它根據自己的需要:

class YourFutureTask extends FutureTask<String> { 

    private Callable<String> callable; 

    public YourFutureTask(Callable<String> callable){ 
    super(callable); 
    this.callable = callable; 
    } 

    public Callable<String> getCallable(){ 
    return callable; 
    } 
} 
相關問題