人性就是这样,与别人发生了什么事,是被怎样批评的相比,他们更愿意关心自己在早饭前和后,一直到凌晨干了些什么事。普通人根本就不会想到别人,他们对自己小问题的关心程度,远远超出别人那些所谓大消息的一千倍。
import java.lang.reflect.Field;
import java.math.BigDecimal;
/**
* 数组反射
*
* @author ningdalong
*
*/
public class ArrayReflect {
public String[] a;
public Integer[] b(BigDecimal[] a) {
// 参数反射
Class<?> parameterType = a.getClass().getComponentType();
System.out.println(parameterType.getName());
// 本地变量
Integer[] is = new Integer[0];
Class<?> localType = is.getClass().getComponentType();
System.out.println(localType.getName());
return is;
}
public static void main(String[] args) throws NoSuchFieldException, SecurityException {
// 属性反射
Field field = ArrayReflect.class.getField("a");
Class<?> fieldType = field.getType().getComponentType();
System.out.println(fieldType.getName());
new ArrayReflect().b(new BigDecimal[0]);
}
}