I'm reading the document on CompletableFuture
and The description for thenAccept()
is
Returns a new CompletionStage that, when this stage completes normally, is executed with this stage's result as the argument to the supplied action.
and for thenApply()
is
Returns a new CompletionStage that, when this stage completes normally, is executed with this stage's result as the argument to the supplied function.```
Can anyone explain the difference between the two with some simple examples?
question from:https://stackoverflow.com/questions/45174233/difference-between-thenaccept-and-thenapply