The FunctionalInterface Annotation #java #shorts

preview_player
Показать описание

#airhacks
Рекомендации по теме
Комментарии
Автор

I never saw a reason for this annotation, because even if you do not annotate your SAM interface, it could be used as a lambda method.

Now there is a reason.

It is like @Override annotation. You don't really need it, but it helps the compiler to assert you're actually overriding a method instead of just declaring a new one.

donizetevida
Автор

A single abstract method. (but static methods or default methods can be several, more than one).

badrstore
welcome to shbcf.ru