Java tutorial
//package com.java2s; // it under the terms of the GNU Lesser General Public License as published by import java.util.Collection; import java.util.Iterator; public class Main { public static char[] asCharArray(Collection<Character> collection) { char[] array = new char[collection.size()]; Iterator<Character> iterator = collection.iterator(); int i = 0; while (iterator.hasNext()) { array[i++] = iterator.next(); } return array; } }