This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Is it possible to sort a 2 dimensional array with Arrays.sort()? It works great with a one dimensional array. I have a simple 2 dimensional array of strings  . I want to sort on the first element.
I don't think you can directly use sort, but someting like this should be a good starting point:
According to my Java in a Nutshell, in most cases the Comparator.compare method should be implemented to return 0 only when o1.equals(o2) returns true. My example doesn't abide by that rule, so there may be a better way to sort this... Cheers, Neil
Originally posted by Neil Laurance: I don't think you can directly use sort[...]
You can - there is also an Array.sort method that gets a Comparator.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus