I have the following anonymous Runnable
implementation.
(我有以下匿名Runnable
实现。)
Runnable cronTask = new Runnable() {
@Override
public void run() {
// do something
}
};
IntelliJ suggests that I replace it with a lambda expression.
(IntelliJ建议我将其替换为lambda表达式。)
eg: (例如:)
Runnable cronTask = () -> {
// multiple "do something" statements
};
When using a single statement the syntax is:
(使用单个语句时,语法为:)
Runnable cronTask = () -> doSomething();
What shortcut can I use to convert it?
(我可以使用什么快捷方式进行转换?)
ask by Technotronic translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…