~/ 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/6ec2b5f6-11c6-4de8-874b-58b5658e067f/flashcard utf-8 LF