Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

sort 2d array by column java

Arrays.sort(contests, (a, b) -> Integer.compare(b[0],a[0])); //decreasing order
    
Arrays.sort(contests, (a, b) -> Integer.compare(a[0],b[0]); //increasing order
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sort #array #column #java
ADD COMMENT
Topic
Name
5+1 =