📜  java 检查类是否是子类 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:43.983000             🧑  作者: Mango

代码示例1
boolean is_subclass = Superclass.class.isAssignableFrom(Subclass.class);
// example:
// List.class.isAssignableFrom(LinkedList.class) is true
// List.class.isAssignableFrom(HashMap.class) is false