August 14, 2022

Java 8 method references, double colon (::) operator

In Java 8, the double colon (::) operator is called method references. There are four kinds of method references: 1 – Reference to a static method ClassName::staticMethodName, 2 – Reference to an instance method of a particular object Object::instanceMethodName, 3 – Reference to an instance method of an arbitrary object of a particular type ContainingType::methodName, 4 – Reference to a constructor ClassName::new

Java 8 method references, double colon (::) operator Read More