private boolean[] toPrimitiveArray(final List<Boolean> booleanList) {
final boolean[] primitives = new boolean[booleanList.size()];
int index = 0;
for (Boolean object : booleanList) {
primitives[index++] = object;
}
return primitives;
}
Showing posts with label array. Show all posts
Showing posts with label array. Show all posts
Tuesday, November 5, 2013
Wednesday, July 11, 2012
Java Collection Set to Array
If you want to change your Set implementation to Array this is the way you can make it:
Set<String> set = new HashSet<String>();
String[] array = set.toArray(new String[set.size()]);
String[] array = set.toArray(new String[set.size()]);
Subscribe to:
Posts (Atom)