Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Sort comparator in java

int[][] twoDim = { { 1, 2 }, { 3, 7 }, { 8, 9 }, { 4, 2 }, { 5, 3 } };

Arrays.sort(twoDim, (int[] o1, int[] o2) -> o2[0] - o1[0]);

System.out.println(Arrays.deepToString(twoDim));
Comment

PREVIOUS NEXT
Code Example
Java :: Binary tree using linked list in Java 
Java :: declaration of list in java 
Java :: set solid color background android programatically in drawable 
Java :: java code for square 
Java :: quicksort for arraylist 
Java :: android java shared preferences remove key 
Java :: Bad notification for startForeground: java.lang.RuntimeException: invalid channel for service notification: Notification 
Java :: check if char is a space java 
Java :: hide steam games from friends 
Java :: print string in java 
Java :: Java for and while loops 
Java :: while loop in java 
Java :: Java printf() Method using PrintWriter 
Java :: first character string number java 
Java :: java array sortieren 
Java :: java instanceof 
Java :: richest customer wealth leetcode 
Java :: creating a menu in java 
Java :: writing values in 2d array java 
Java :: set toolbar background color android 
Java :: fastreader in java 
Java :: get array element java 
Java :: phone number format java 
Java :: java node class 
Java :: list java 
Java :: Employee Java. 
Java :: jcolorchooser in java 
Java :: how to convert string to int in java 
Java :: how to draw a triangle in java 
Java :: queue.isempty java 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =