Friday, November 10, 2023

Functional Interface

Generic Functional Interface:
package LambdaGenericsExample1;
@FunctionalInterface
public interface FunctionalGenerics {
	R execute(T t);
}
Here,
  R -> Return type
  T -> Takes a string as a parameter
  
It's having abstract method execute. It takes a String and returns a string.

No comments:

Post a Comment