I was exploring the Java 8 source and found this particular part of code very surprising:
//defined in IntPipeline.java
@Override
public fin
Double colon i.e. :: operator is introduced in Java 8 as a method reference. Method reference is a form of lambda expression which is used to refer the existing method by its name.
classname::methodName
ex:-
stream.forEach(element -> System.out.println(element))By using Double Colon ::
stream.forEach(System.out::println(element))