Java double colon operator

import java.util.Arrays;
import java.util.List;

public class DoubleColonDemo03 {
    public static void main(String[] args) {
        List array = Arrays.asList(1, 2, 3);
        array.forEach(num -> System.out.println(num));
        System.out.println("*************");
        array.forEach(System.out::println);
    }
}
1
2
3
*************
1
2
3

你可能感兴趣的:(Java double colon operator)