Java tutorial
//package com.java2s; import java.lang.reflect.Array; public class Main { public static Object[] getArray(Object val) { int len = Array.getLength(val); Object[] outputArray = new Object[len]; for (int i = 0; i < len; ++i) { outputArray[i] = Array.get(val, i); } return outputArray; } }