Determining the extended interfaces of a Class

前端 未结 5 805
太阳男子
太阳男子 2020-12-20 13:48

I need to determine if a Class object representing an interface extends another interface, ie:

 package a.b.c.d;
    public Interface IMyInterface extends a.         


        
5条回答
  •  半阙折子戏
    2020-12-20 14:37

    Take a look at Class.getInterfaces();

    List list = new ArrayList();
    for (Class c : list.getClass().getInterfaces()) {
        System.out.println(c.getName());
    }
    
        

    提交回复
    热议问题