# column « Sort « Java Collection Q&A

Home
Java Collection Q&A
 1 algorithm 2 array 3 Array Byte 4 Array Char 5 Array Convert 6 Array Dimension 7 Array Integer 8 Array Object 9 Array String 10 ArrayList 11 collection 12 comparator 13 Development 14 Garbage Collection 15 Generic 16 hash 17 HashMap 18 HashTable 19 iterator 20 LinkedList 21 List 22 Map 23 queue 24 Set 25 Sort 26 tree
 Java Collection Q&A » Sort » column

### 1. Sort a two dimensional array based on one column    stackoverflow.com

In Java, I have a data in my array like the following

``````2009.07.25 20:24 Message A
2009.07.25 20:17 Message G
2009.07.25 20:25 Message B
2009.07.25 20:30 Message D
2009.07.25 20:01 Message F
2009.07.25 21:08 Message E
2009.07.25 19:54 ...``````

### 2. compareTo() and Collections.sort() Solution For Multiple Column Ordering (Ascending) question    stackoverflow.com

Am somewhat confused with Java's compareTo() and Collections.sort() behavior. I am supposed to sort a column in ascending order using compareTo() & Collections.sort(). My criteria is (if the same number occurs than please ...

### 3. Sorting a 2D Integer array based on a column    stackoverflow.com

first post on here. This question relates to Java. I have a 2D-array that I want to sort based on the second column. The first column should remain paired with the second ...

### 4. How to sort the first column in a 2-dimensional array based on the second?    stackoverflow.com

For example: My first column in the array is at first numerically in order. The Second column is numerically random. I want to place the second column in order, which of course ...

### 5. Java sort array based on three column    stackoverflow.com

On my quest learning Java I come across one doubt. For sorting a unidimensional array we can use Arrays.sort() but if I want to sort a bidimensional array based on three columns? ...

### 6. Algorithms: Sorting data on basis of three columns    coderanch.com

Won't they be in the correct order if you simply sort them three times, starting with the third thing you want it sorted on and moving to the second then the first, each time using the results of the previous sort? You should be able to do each sort using a different Comparator and Collections.sort(List, Comparator). For example, if I wanted ...

### 7. compareTo() and Collections.sort() Solution For Multiple Column Ordering (Ascending) question    coderanch.com

Am somewhat confused with the compareTo() and Collections.sort() behavior. I am supposed to sort a column in ascending order using compareTo() & Collections.sort(). My criteria is (if the same number occurs than please sort the next available column). (1) Document Number (2) Posting Date (3) Transaction Date (4) Transaction Reference Number Comparison Here's the code (which is executed in a calling ...

### 8. Sort 2D array columns independently    go4expert.com

Hello, I have a 2D array of ints that I need to sort independently by columns in descending order. For example right now I have: 0 1 2 3 4 5 19 7 33 9 10 11 24 13 14 15 16 43 30 19 20 21 22 23 24 and i want it to have the largest number in each ...

### 9. multidimensional array sort by column problem    forums.oracle.com

int [][] array = new int[][] {{6,12,12}, {3,18,18}, {4,24,24}, {6,30,10}}; I am trying to sort this array by the second column and i cant really find a solution. I hope I'm not being thick here, and misleading you - if so, I'm sure someone will point that out... But is this "second column" you are talking about 12-18-24-30? In other words ...