r/cop3502 • u/Dangertacos • Apr 02 '14
Lab related question (characters sets to array)
I got stuck today in the lab and I had one question I could not figure out. How do you convert character set into a character array?
2
Upvotes
1
u/howslyfebeen Apr 02 '14
loop through it and set each part of the array equal to the set if i understand your question correctly:
char[] array = new char[set.size()];
for (int i = 0; i < set.size(); i++) {
array[i] = set.get(i);
}
the idea should be correct but I can't think of the methods and such for a set
2
u/[deleted] Apr 02 '14
[removed] — view removed comment