public static Object getPrimitiveDefaultValue(Class<?> primitiveType) {
        if (boolean.class.equals(primitiveType)) {
            return false;
        } else if (byte.class.equals(primitiveType)) {
            return (byte) 0;
        } else if (char.class.equals(primitiveType)) {
            return '\0';
        } else if (short.class.equals(primitiveType)) {
            return (short) 0;
        } else if (int.class.equals(primitiveType)) {
            return 0;
        } else if (long.class.equals(primitiveType)) {
            return 0L;
        } else if (float.class.equals(primitiveType)) {
            return 0F;
        } else if (double.class.equals(primitiveType)) {
            return 0D;
        } else {
            return null;
        }
    }
public static Object getPrimitiveDefaultValue ( Class < ? > primitiveType ) { if ( boolean . class . equals ( primitiveType ) ) { return false ; } else if ( byte . class . equals ( primitiveType ) ) { return ( byte ) 0 ; } else if ( char . class . equals ( primitiveType ) ) { return '\0' ; } else if ( short . class . equals ( primitiveType ) ) { return ( short ) 0 ; } else if ( int . class . equals ( primitiveType ) ) { return 0 ; } else if ( long . class . equals ( primitiveType ) ) { return 0L ; } else if ( float . class . equals ( primitiveType ) ) { return 0F ; } else if ( double . class . equals ( primitiveType ) ) { return 0D ; } else { return null ; } }
取得primitive类型的默认值。

@param primitiveType 基本类型
@return 默认值