Use of this website is subject to mandatory arbitration and other terms and conditions, select this link to read those agreements.
Skip to content

Search

Sup Java .com -

// Filter and collect names longer than 3 chars List<String> longNames = names.stream() .filter(name -> name.length() > 3) .collect(Collectors.toList()); System.out.println(longNames); // [Alice, Charlie]