标签: kotlin
据我所知,Boolean::class.java给了我Boolean.TYPE,但没有Boolean.class
Boolean::class.java
Boolean.TYPE
Boolean.class
答案 0 :(得分:12)
要引用Java原语和盒装类型,请使用:
Boolean::class.javaPrimitiveType(相当于Java Boolean.TYPE)
Boolean::class.javaPrimitiveType
Boolean::class.javaObjectType(相当于Java Boolean.class)
Boolean::class.javaObjectType