Check out example codes for "lambda expression in java". It will help you in understanding the concepts better.

Code Example 1

StateOwner stateOwner = new StateOwner();

stateOwner.addStateListener(
    (oldState, newState) -> System.out.println("State changed")
);

Code Example 2

(p1, p2) -> System.out.println("Multiple parameters: " + p1 + ", " + p2);

Learn ReactJs, React Native from akashmittal.com