Dear all,
Here is my code :
String sql = "select * from customer";
Vector v = new Vector();
// Retrieve the sql data into a vector
for(int i=0; i<v.size(); i++)
{
custname = v.elementAt(0);
custaddr = v.elementAt(1);
.......
---- Collections.sort(v, v.elementAt(1));
out.println(custname);
out.println(custaddr);
}
I just want to sort the custaddr in my vector,
First I paste (Collections.sort(v)), it works fine.
But after I paste the comparator (v.elementAt(1)),
the error message occur:
No match was found for method :
sort(java.util.Vector, java.lang.Object)
Can anyone help me to clarify my understanding???
In API, there have a method call
sort(List list, Comparator c)
Is vector is a list???
Or maybe I can only use method
sort(Vector) ?
Sorry about this silly question!!!
Thanks in advance !
Kelly