如果我有publicdoSomething(T[]array){}如何从array获取T.class?如果我执行array.getClass()会得到我的T[].class。 最佳答案 组件类型使用这个:array.getClass().getComponentType()ReturnstheClassrepresentingthecomponenttypeofanarray.Ifthisclassdoesnotrepresentanarrayclassthismethodreturnsnull.引用:Class.getCompon