程序清单-利用反射扩展任意类型的数组

一、 得到a数组对应的类对象javascript Class cl = a.getClass(); 二、确认是一个数组java if (!cl.isArray()){ return null; } 三、使用Class类的getComponentType方法肯定数组对应的类型web Class componentType = cl.getComponentType(); 四、构造新数组数
相关文章
相关标签/搜索