First off hello everyone.
as you can see i have declaed a "Set" called "dupes" assume it has values
i have a function to get this set. its called getDupes();
i want getDupes(); to return this set as an array via the set.toArray(); method. but i am totally confused as to the documentation on this.
by default the .toArray(); method seems to return an array of type Object[]. how would one return this array of type int[] as all values in this set are of type int[]
heres the code.
private Set<Integer> dupes = new HashSet<Integer>();
...
...
public int[] getDupes() {
return this.dupes.toArray();
}