What does the `@FunctionalInterface` annotation enforce?

Java Professional Easy

Java Professional — Easy

What does the `@FunctionalInterface` annotation enforce?

Key points

  • `@FunctionalInterface` requires one abstract method
  • Helps in functional programming
  • Prevents accidental addition of extra abstract methods

Ready to go further?

Related questions