Method Reference
New Feature introduce in java 8 is Method Reference. Method reference is used to implement the method of functional interface from another class method. Only condition that Functional interface method and method which we are going to implement should have same signature and return type
Functional Interface
Functional interface is an interface which have only one abstract method.
In Blow Example Override the method of interface by using Implements Keyword
Same Example implemented Using Double colon operator
Assigned B class method implementation to A interface method without implementing A interface to class B(new B():: test)
We can use java Predefined methods also to implement the method of functional interface. In below example we used java predefined method println to implement method of interface A(System.out::println)