Which method is used to obtain the result from a Future object?

  • fetchResult()
  • get()
  • getResult()
  • obtainResult()
The get() method is used to obtain the result from a Future object in Java. This method is called on a Future instance, and it blocks until the result is available if it's not already computed. It returns the result of the computation or throws an exception if the computation encountered an error.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *