cron.addDateAction(new DateAction(d3, new Actionable() {
@Override
public void execute() {
for(int i = 0; i < 10; i++){
System.out.println(i);
}
}
}));
I am studying and found this code; I have never seen this way of creating an object but besides that, my question is:
Actionable is an interface, so it can't be instantiated, this means the new Actionable(){...}
part creates a subclass object of the interface, but why?