Here you can find the source of getInterfaceNames(Class> c)
public static String[] getInterfaceNames(Class<?> c)
//package com.java2s; /* /*from w w w . j a v a 2 s. c om*/ * Copyright (C) 2013-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"). * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * Create by ZollTy on 2013-9-11 (http://blog.zollty.com, zollty@163.com) */ import java.util.ArrayList; import java.util.List; public class Main { public static String[] getInterfaceNames(Class<?> c) { Class<?>[] interfaces = c.getInterfaces(); List<String> names = new ArrayList<String>(); for (Class<?> i : interfaces) { names.add(i.getName()); } return names.toArray(new String[interfaces.length]); } }