Friday, May 10, 2019

Method Reference In Java 8

Java Method References

Java 8 provides a new feature method referenc. Method reference is used to refer method of functional interface. It is compact and easy form of lambda expression. Each time when you are using lambda expression to just referring a method, you can replace your lambda expression with method reference.

There are following types of method references in java:

  • Reference to a static method.
  • Reference to an instance method.
  • Reference to a constructor.

No comments:

Post a Comment