• Post Reply Bookmark Topic Watch Topic
  • New Topic

sorting a 2 multi-dimensional array  RSS feed

 
vaibhav dobriyal
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it possible to sort a multi-dimensional array on basis of one of the attributes....hmm let me xplain a bit
say i have an array [a][b][c].
is it possible to sort on the basis of b alone.
I couldn't find a method/logic to do so.

ne pointers!!
TIA
dobi

"u don't get to be mom until u can fix everything just right" --calvin
 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a) Java does not have 2-dimensional arrays.
b) The concept of sorting an array of arrays of arrays is not well defined - you'll have to provide more context
 
steve souza
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are talking about sorting a 2 dimensional array of objects then you can use the ArraySQL class that can be found at http://www.fdsapi.com. You can use a SQL like syntax to sort arrays with it.
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by dobriyal dobriyal:
is it possible to sort a multi-dimensional array on basis of one of the attributes....hmm let me xplain a bit
say i have an array [a][b][c].
is it possible to sort on the basis of b alone.
I couldn't find a method/logic to do so.

ne pointers!!
TIA
dobi

"u don't get to be mom until u can fix everything just right" --calvin



It's possible to do that.

Why you want to do in this solution ?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!