Java中的判断实例

  • .getClass().getName() 这是最常见的一种判断类型的方法

  • instanceof 用于判断 对象 是否为某个类的实例 Boolean值

  • 各种is方法

    • isAnnotationPresent(*.class) 判断是否含有某个特定注解,注意.class后缀
原文地址:https://www.cnblogs.com/cuteb/p/13533969.html