0
0

More than 1 year has passed since last update.

stream map method

Posted at

Function interfaceを渡す
return type is Stream<R>

public class Outer {
    public static void main(String[] args) {
        List<Integer> l = List.of(1,2,3,4,5);
        l.stream().<String>map(a -> String.valueOf(a) + "xxx").forEach(System.out::println);
    }
}
1xxx
2xxx
3xxx
4xxx
5xxx
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0