java functional interface vs interface code example Example: interface function interface SearchFunc { (source: string, subString: string): boolean; }