~/ learn/ java-from-zero/ cards/ Functional interfaces & @FunctionalInterface
1 of 4

Type a @FunctionalInterface declaration

Type a @FunctionalInterface declaration

Answer

@FunctionalInterface interface Transformer { String transform(String input); }

The annotation is optional but strongly recommended: it makes the compiler enforce the one-abstract-method rule and makes the design intent explicit to readers.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/8fa37489-d406-4464-b339-c068afe9014a/flashcard utf-8 LF