【发布时间】:2016-08-02 13:59:52
【问题描述】:
我知道在swift中,有一个关键字叫variableName.dynamicType,用来标识变量所属的类型。我只是想知道java中是否有类似的关键字?
【问题讨论】:
标签: java variables types dynamictype
我知道在swift中,有一个关键字叫variableName.dynamicType,用来标识变量所属的类型。我只是想知道java中是否有类似的关键字?
【问题讨论】:
标签: java variables types dynamictype
有Object#getClass(给你一个java.lang.Class):
Object x = new BigInteger(123);
System.out.println(x.getClass().getSimpleName());
【讨论】: