check if a class is Descendant of another class - Android java.lang.reflect

Android examples for java.lang.reflect:Class

Description

check if a class is Descendant of another class

Demo Code


//package com.java2s;

public class Main {
    public static boolean isDescendant(Class<?> descendant,
            Class<?> anchestor) {
        return anchestor.isAssignableFrom(descendant);
    }/*  ww w .java 2 s  .com*/
}

Related Tutorials