Why is this method reference failing at runtime but not the corresponding lambda call?
问题 I have these two interfaces. One is public (A), the other one is package private (AA). A extends AA . package pkg.a; @FunctionalInterface public interface A extends AA { } . package pkg.a; interface AA { default void defaultM() { System.out.println(m()); } String m(); } I have this code (in a different package): package pkg; import java.util.Arrays; import java.util.List; import pkg.a.A; public class Test { public static void main(String[] args) { List<A> list = Arrays.asList(() -> "imp1", ()