java functional interfaces for lambda expressions? code example
Example 1: how to use lambda in java
StateOwner stateOwner = new StateOwner();
stateOwner.addStateListener(
(oldState, newState) -> System.out.println("State changed")
);
Example 2: creating the functional interface in java
package com.concretepage;
@FunctionalInterface
public interface Calculator {
long calculate(long num1, long num2);
}