getComponentType()意义和用法
Class<?> java.lang.Class.getComponentType()
Description:
Returns the Class representing the component type of an array. If this class does not represent an array class this method returns null.
Returns:
the Class representing the component type of thisclass if this class is an array
说明:返回数组中元素的Class对象,如果不是Class对象那么返回null
//JAVA中getComponentType()的用法
package com.zm.exercise;
public class E01_GetComponentType {
public static void main(String[] args) {
// 正常方式创建 一个String数组
String[] strArr = new String[10];
for (int i = 0; i