I want to write an asynchronous method that returns a CompletableFuture. The only purpose of the future is to track when the method is complete, not its result. Would it be bett
Would it be better to return CompletableFuture
or CompletableFuture> Is there a reason to prefer one or the other, or are they interchangeable?
There are three contexts which code may affect:
Future
but won't accept Future>
.Future
's result have no meaning, then it is a good practice to say about that to the users through the declaration.So Future
is more preferable.