To retrieve the vector objects randomly

Hai all,How can i retreive the vector objects randomly,not in the order.Thanks in advance.
[104 byte] By [cpt1a] at [2007-11-26 17:28:24]
# 1
Instade of Vector use HashMap ..can u can access objects in it ramdomly by using key of it
debduttaa at 2007-7-8 23:56:20 > top of Java-index,Java Essentials,New To Java...
# 2
If you know the index of your object, just useVector.get(index)elseTry HashMap. There you can retrieve using keys as values are stored as key, value pair
saracgia at 2007-7-8 23:56:20 > top of Java-index,Java Essentials,New To Java...
# 3

In 1.6 the Collections class has cool stuff! like sort... and Vector was enhaced to support List.... There's even an example in the [url=http://java.sun.com/docs/books/tutorial/collections/algorithms/index.html#sorting]tutorial[/url]. I do Luv java sometimes :-)

There where good examples in the old 1.4/5 tutorials, which is not available from Sun any longer, but there are still a mirrors hanging around... google hard.

Keith.

corlettka at 2007-7-8 23:56:20 > top of Java-index,Java Essentials,New To Java...