提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
获取类接口
//package com.nowjava; public class Main {//时代Java 提供 public static void main(String[] argv) throws Exception { Class classInstance = String.class; getClassInterfaces(classInstance); } public static void getClassInterfaces(Class<?> classInstance) { Class cc[]; Class ctmp; cc = classInstance.getInterfaces(); if (cc.length != 0) System.out.print(", /r/n" + " implements ");