almost 10 years ago
The interface with only a single methods is known as functional interface. If an interface marked as @FunctionalInterface it can only contains one abstract method. If we try to declare more than one abstract method inside FunctionalInterface compiler will produce the error.
For example -
The above example is correct and will compile successfully, but the below example cannot be compiled and will throw the error:
Hope this will help you :)
0 Comment(s)