No target method found in functional interface

Viewed 2183

I am trying to learn more about the Java 8 FunctionalInterface annotation. I wrote the following code as an experiment, but it does not compile:

@FunctionalInterface
public interface HasToString {

    String toString();
}

No target method found

Interestingly, this does compile:

@FunctionalInterface
public interface HasToString {

    String notToString();
}

Why is this?

1 Answers
Related