method parameters questions

publicstaticvoid sort(Sortable[] items){

for (int i = 1; i < items.length; i++){

Sortable key = items[i];

int position = i;

while (position > 0 && (items[position - 1].compareTo(key) > 0)){

items[position] = items[position - 1];

position--;

}

items[position] = key;

}

}

as you can see that this method takes an array of sortable...my question is how to make it take a vector of sortable?

i am obliged to use vectors so please dont suggest a new data structure or a new collection....

please help

thanks in advance

[1013 byte] By [fouadka] at [2007-11-26 22:48:38]
# 1

public static void sort(java.util.Vector<Sortable> items) {

// ...

}

Look at the API docs to see which methods to use to get items from your Vector:

http://java.sun.com/j2se/1.5.0/docs/api/java/util/Vector.html

prometheuzza at 2007-7-10 12:08:35 > top of Java-index,Java Essentials,Java Programming...
# 2
****, that was sooooo stupid, i use this particular line of code daily but as i always say: the easiest and most obvious solutions are the hardest to find and think aboutthanks alot for your help
fouadka at 2007-7-10 12:08:35 > top of Java-index,Java Essentials,Java Programming...