Concatenating two int[]

后端 未结 3 900
野的像风
野的像风 2020-12-15 18:02

There are easy solutions for concatenating two String[] or Integer[] in java by Streams. Since int[] is frequently used.

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-15 18:06

    You can simply concatenate primitive(int) streams using IntStream.concat as:

    int[] m = IntStream.concat(IntStream.of(c), IntStream.of(d)).toArray();
    

提交回复
热议问题