Java 8 pass method as parameter

后端 未结 2 1192
自闭症患者
自闭症患者 2020-12-23 15:54

Currently getting into Java 8 lambda expressions and method references.

I want to pass a method with no args and no return value as argument to another method. This

2条回答
  •  难免孤独
    2020-12-23 16:39

    It really does not matter; Runnable will do too.

    Consumer,
    Supplier,
    Function
    

提交回复
热议问题