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
Rootinterface 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
Methodobjects. 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 ClassBmethods list, is it possible to identifygetValue()is overridden method and its signature is defined in theRootinterface?
Aucun commentaire:
Enregistrer un commentaire