Snippets tagged “functional-interface”
2 snippets use this tag.
- How to pass a function as a parameter in Java?Java
In Java, you can pass a function as a parameter using a functional interface. A functional interface is an interface that has a single abstract method. You can create a functional interface by annotating an interface with the @FunctionalInterface annotati
- Java 8 Lambda function that throws exception?Java
In Java 8, you can use a lambda expression to create a functional interface that throws an exception.