Skip to content

Instantly share code, notes, and snippets.

@deepakmehra10
Created July 14, 2019 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deepakmehra10/4c3ef11749f5b209e8f8c6fe5ffbe5fe to your computer and use it in GitHub Desktop.
Save deepakmehra10/4c3ef11749f5b209e8f8c6fe5ffbe5fe to your computer and use it in GitHub Desktop.
CheckedFunction2<Integer,Integer, Integer> divide = (a, b) -> a/b ;
Try<Integer> failure = Try.of(() -> divide.apply(5, 0));
System.out.println(failure);
Try<Integer> success = Try.of(() -> divide.apply(5, 1));
System.out.println(success);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment