Created
January 26, 2020 05:36
-
-
Save nkalra0123/51170509ff49bd71488f39a67cf07443 to your computer and use it in GitHub Desktop.
Binary Operator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// BinaryOperator | |
System.out.println("binaryOpeartor = " + Stream.of(1,2,3,4). | |
reduce(new BinaryOperator<Integer>() { | |
@Override | |
public Integer apply(Integer x, Integer y) { | |
return x + y; | |
} | |
}).get()); | |
System.out.println("binaryOpeartor = " + Stream.of(1,2,3,4).reduce((x, y) -> x + y).get()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment