java8 stream of arrays to 2 dimensional array
问题 I'm new to Java8 and I can't use streams to map one array into another 2 dimensional array. I have one 2-dimensional array which is a pattern: boolean[][] pattern = { {true, true, false}, {true, false, true}, {false, true, true} }; And second array which contains keys. 0 means: take 0-element from pattern 1 means: take 1-element from pattern and so on int[] keys = {2, 1, 0}; From these 2 arrays I'd like to produce another 2-dimensional array. In this case the result will look like this: