stream of map elements in java code example
Example: map streams java
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
public class Main
{
public static void main(String[] args)
{
List<String> listOfStrings = Arrays.asList("1", "2", "3", "4", "5");
List<Integer> listOfIntegers = listOfStrings.stream()
.map(Integer::valueOf)
.collect(Collectors.toList());
System.out.println(listOfIntegers);
}
}