A string operator

Report a typo

Suppose, you are writing a new interface for processing strings via lambda expressions. You have several options to write it. Select all of them that can be marked with the @FunctionalInterface annotation.

// a
interface StringOperator {
    String apply(String value);
    boolean checkNotNull(String value);
}

// b
interface StringOperator {
    String apply(String value);
}

// c
interface StringOperator extends Function<String, String> {

}

// d
interface StringOperator {
    String apply(String value);
    
    default boolean checkNotNull(String value) { 
        return !Objects.isNull(value);
    }
}

To solve this problem, it is recommended to try it in code or think well.

Select one or more options from the list
___

Create a free account to access the full topic