For example:
interface Root<T> {
public T getValue();
}
class A implements Root<String> {
public String getValue() {
return "";
}
}
class B implements Root<Integer> {
public int getValue() {
return 0;
}
}
- Is it possible to get a class details that are implemented
Root
interface via Java Reflection? I want the answer like this: [class A details, and class B details] - In reflection, we can able to fetch method details via
Method
objects. Is it possible to identify a particular method is an interface method, ie: it is an override method but its signature is defined in that particular interface. For eg: I get ClassB
methods list, is it possible to identifygetValue()
is overridden method and its signature is defined in theRoot
interface?
Aucun commentaire:
Enregistrer un commentaire