get Class Interfaces - Java Reflection

Java examples for Reflection:Interface

Description

get Class Interfaces

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        Class classInstance = String.class;
        getClassInterfaces(classInstance);
    }//from w  w w  . j  a v a2 s. c o m

    public static void getClassInterfaces(Class<?> classInstance) {

        Class cc[];
        Class ctmp;
        cc = classInstance.getInterfaces();

        if (cc.length != 0)
            System.out.print(", /r/n" + " implements "); 

        for (Class cite : cc)
            System.out.print(cite.getName());
    }
}

Related Tutorials