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

Related questions

0 votes
asked Mar 1, 2023 in JAVA by sharadyadav1986
+1 vote
asked Jan 24, 2020 in JAVA by rahuljain1
...