(String[] args)
| 15 | System.out.println("someOtherName()"); |
| 16 | } |
| 17 | public static void main(String[] args) { |
| 18 | BiConsumer<In1,In2> bic; |
| 19 | |
| 20 | bic = MethodConversion::accept; |
| 21 | bic.accept(new In1(), new In2()); |
| 22 | |
| 23 | bic = MethodConversion::someOtherName; |
| 24 | // bic.someOtherName(new In1(), new In2()); // Nope |
| 25 | bic.accept(new In1(), new In2()); |
| 26 | } |
| 27 | } |
| 28 | /* Output: |
| 29 | accept() |