If you want you can convert arrays to Lists or Sets and Lists and Sets to arrays. This can be acheived by using the asList() method
defined in the java.util.Arrays class and the toArray() method defined in the Collection interface . Heres an example.
Code:
import java.util.*;
public class CollectionTest{
public static void main(String[] args){
String[] greeting = {"Hello", "my", "name", "is", "brandon"};
// convert array to list.........
List l = new LinkedList(Arrays.asList(greeting));
// itenerate through the list
ListIterator literator = l.listIterator();
while(literator.hasNext()){
System.out.println(" Output from l " + literator.next());
}
// list back to String array........
String[] uniquearray = (String[]) l.toArray(new String[0]);
for(int i = 0; i < uniquearray.length; ++i){
System.out.println(" Output from uniquearray " + uniquearray[i]);
}
}
}