This is directly in the forEach loop inside the function array, and the way you introduced to print
If you want to return instead of printing, how to return big advice please
Try (Stream
List
The filter (s - & gt; S.c ontains (" password "))
Collect (Collectors. ToList ());
FilteredLines. ForEach (System. Out: : println ).
} the catch (IOException e) {
e.printStackTrace();//just test cases, production environment don't do that exception handling
}
CodePudding user response:
Lambda expressions, function shorthand, before we need new an object to call methods, and then through the call object method, now have the lambda expressions, by the name of the class: : call the method nameCodePudding user response:
Like System. Out: : println and Stream supporting it,