public interface Eat<T, F> {
void eat(T things, F f);
}
public class Food {
String foodName;
}
public class Fruit {
String fruitName;
}
public class Dog implements Eat<Food, Fruit>, Runnable {
@Override
public void eat(Food things, Fruit f) {
}
@Override
public void run() {
}
@Test
public void main() {
Class<?> clazz = Dog.class;
Type[] genericInterfaces = clazz.getGenericInterfaces();
Class<?>[] interfaces = clazz.getInterfaces();
}
}
截图是getGenericInterfaces返回值,具体解释可以看下面博客
https://blog.csdn.net/weixin_33794672/article/details/92037106#commentBox
--------------------------