判断类和类之间的父子关系

这里的“类”包括类和接口

用java.lang.Class中的方法:

    fatherClass.isAssignableFrom(sonClass)

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.