Possible Duplicate:
How to convert object array to string array in Java
I am receiving an Object and casting it into a String array like this:
Object values[] = (Object[])request.getSession().getAttribute("userList");
String[] tmp = new String[values.length];
for(int i = 0; i < tmp.length; ++i) {
tmp[i] = (String) values[i];
out.println(tmp[i]);
}
Is there any better and cleaner way to do this?