Hello I Just started learning Lambda expressions, how do I write this with Lambda expressions?
public static void greaterThanFive(String str){
if(str.length() > 5){
System.out.println("String length is larger than 5 ");
}else{
System.err.println("String length less than 5");
}
if it was just an, if statement I could just do this:
Predicate<String> greaterThanFive = (s)-> s.length() > 5;
But I can't really figure out when it's an if-else statement.