How do I find the Java interface whose method is implemented in a given class?
问题 I need quite the opposite of what most people want to juggle with: I have a StackTraceElement with className and methodName. As the method belongs to an interface given class implements, I need a way I can ask the method which interface it originates in. I can invoke Class.forName(className) and can also invoke clazz.getMethod(methodName) , however method.getDeclaringClass() returns with the mentioned class' name instead of its original interface'. I don't want to iterate through all the