I want to know if it's possible to convert a Java List
of String
s to an array of String
s:
I tried this:
List<String> products = new ArrayList<String>();
//some codes..
String[] arrayCategories = (String[]) products.toArray();
but it gives me an exception message:
java.lang.ClassCastException: java.lang.Object[] cannot be cast to java.lang.String[]