In Java we have the Class::new
syntax for constructor references. I know, there are callable references for methods, but how about constructors? A typical use case for me would be factories.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can get a functional instance for constructor by simply using ::ClassName
, as if it were factory function.