Get the return Type for inherited generic method
问题 I have these 3 classes public class Box<O> { public O getItem() {...} } public class CoolBox extends Box<Integer> { ... } public class AmazingBox extends CoolBox { ... } At one point in my code, I need to get the return Type of the method getItem() for the AmazingBox class, but when accessing its methods via reflection, I get Object as the return Type instead of Integer . Is there any way, (plain java or extra libraries) to get Integer as the return Type? This is the code I used to get the