Simon

Simon

  • NA
  • 1
  • 0

ArrayList - adding keys???

Feb 16 2006 8:14 AM

I have an Arraylist of objects - but I want to attach to each object a number (in this case distance of type int).  This will be useful for me to sort on the distance value, the shortest to the longest and then do other operations.

eg.

OBJECT       | INDEX | DISTANCE
-------------------------------
fooOject        [0]     100
fooOject        [1]     1465
fooOject        [2]     8787
fooOject        [3]     21
fooOject        [4]     66....etc


Does anyone know how to do this, bearing in mind Im a bit of C# newbie...


Answers (1)