Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static boolean isImplement(Class<?> clazz, Class<?> interfaceClazz) {
        if (clazz.equals(interfaceClazz))
            return true;

        Class<?>[] ifs = clazz.getInterfaces();
        for (Class<?> i : ifs) {
            if (i.equals(interfaceClazz))
                return true;
        }

        Class<?> s = clazz.getSuperclass();
        if (s == null || clazz.equals(s.getClass()))
            return false;

        return isImplement(s, interfaceClazz);
    }
}