I' m trying to understand @Functional interface from JDK and can't catch why did they create this annotation without a body?
I don't understand what is difference between using @FunctionalInterface in class description and not using? what does this annotation without params provide?
@Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface FunctionalInterface {}
@FunctionalInterfaceannotation is used to ensure an interface can’t have more than one abstract method. The use of this annotation is optional.getDeclaredMethodsfor counting, which is an unnecessary overhead.