This program uses the Stream map() function to convert a list of Strings to uppercase.
Code Example:
public class Java8 {
public static void main(String[] args) {
List<String> names = Arrays.asList("aa", "bb", "cc", "dd");
List<String> nameLst = names.stream()
.map(String::toUpperCase)
.collect(Collectors.toList());
System.out.println(nameLst);
}
}Output:
[AA, BB, CC, DD]