this is about a hw assignment that includes reflection in Java. suppose I have 2 classe :
public class A{
bool foo(){...}
}
public class B extends A{
bool foo(){...}
}
suppose I have a function that receives Class<?>
parameter, and I want to check if foo
is overridden in some derived class, without knowing if there are any, how do I do that?
I read a few questing regarding the same subject, that mentioned isBridge, or getDeclaringclass but can't figure out what those do.
I have to mention that I don't know Java all that well. this is part of an Object Oriented Programming class I'm taking, so it's not meant to make us experts in Java but to demonstrate the principals. which means the solution to my problem shouldn't be too complex.
Aucun commentaire:
Enregistrer un commentaire