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

1 Answer

0 votes
by (19.9k points)

@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().

Related questions

+1 vote
asked Jul 29, 2020 by Hodge (2.6k points)
...