如何将此匿名类转换为lambda表达式:
new Runnable() {
@Override
@Scheduled(fixedDelay = 10000)
public void run() {
System.out.println("Runnable as anonymous class");
}
}
我进行这样的转换:
Runnable r = ()->{System.out.println("Runnable as Lambda expression");};
但是当我尝试放置注释@Scheduled(fixedDelay = 10000)