Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
什么是有效的函数签名funSig?
funSig
funSig(() -> System.out.println());
ARunnable会工作,
Runnable
它匹配一个 void 返回并且没有参数。
Runnable runnable = () -> System.out.println();
显然它不需要Runnable,任何Functional Interface与签名匹配的都可以。
Functional Interface