判断基本类型
ObjectUtil#isBasicType
判断是否为基本类型,包括包装类型和原始类型。
包装类型:
- Boolean
- Byte
- Character
- Double
- Float
- Integer
- Long
- Short
原始类型:
- boolean
- byte
- char
- double
- float
- int
- long
- short
inta=1; Doubleb=2.1d; Stringstr="hl"; booleanflag=false; System.out.println( ObjectUtil.isBasicType(a)); System.out.println( ObjectUtil.isBasicType(b)); System.out.println( ObjectUtil.isBasicType(str)); System.out.println( ObjectUtil.isBasicType(flag));
输出:
true
true
false
true