java stream collect to string

Solutions on MaxInterview for java stream collect to string by the best coders in the world

showing results for - "java stream collect to string"
Isabell
24 Nov 2019
1List<Integer> numbers = Arrays.asList( 4, 8, 15, 16, 23, 42 );
2return numbers.stream()
3        .map( n -> n.toString() )
4        .collect( Collectors.joining( "," ) );