Check out example codes for "How to sort 2d array in java using stream api". It will help you in understanding the concepts better.

Code Example 1

Arrays.sort(myArr, (a, b) -> a[0] - b[0]);

Learn ReactJs, React Native from akashmittal.com