0 votes
in JAVA by
Is the following code flawed in any way? Does it compile or does it produce a specific error?

1 Answer

0 votes
by

@FunctionalInterface

public interface Test<A, B, C> 

public C apply(A a, B b);

default void printString() {

System.out.println("softwaretestinghelp");

  }

  }

Yess. Because the code adheres to the functional web api of specifying only one abstract method, it will compile. A default method which does not qualify as an abstract method is the second one, printString().

...