@FunctionalInterface annotation in Java

\@FunctionalInterface annotation is used to ensure that the functional interface can’t have more than one abstract method. In case more than one abstract methods are present, the compiler flags an ‘Unexpected \@FunctionalInterface annotation’ message. However, it is not mandatory to use this annotation.
While it is a good practice to mark a functional interface with the \@FunctionalInterface annotation for clarity, it is not required with functional programming. The Java compiler implicitly assumes that any interface that contains exactly one abstract method is a functional interface. Conversely, if a class marked with the \@FunctionalInterface annotation contains more than one abstract method, or no abstract methods at all, then the compiler will detect this error and not compile.
One problem with not always marking your functional interfaces with this annotation is that another developer may treat any interface you create that has only one method as a functional interface. If you later modify the interface to have other abstract methods, suddenly their code will break since it will no longer be a functional interface.Therefore, it is recommend that you explicitly mark the interface with the \@FunctionalInterface annotation so that other developers know which interfaces they can safely apply lambdas to without the possibility that they may stop being functional interfaces down the road.
```
@FunctionalInterface
interface Square {
    int calculate(int x);
}
  
class Main {
    public static void main(String args[]){
        Square s = (x) -> x * x;
        System.out.println(s.calculate(5));
    }
}
```