I have a list of classes that extend the same superclass, which has a static field called foo:
List<Class<? extends SuperClass>> list;
how can I access foo on an element of that list?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Why should
not work? Since it is static, your
Listis completely irrelevant. And also the child classes, since the field exists exactly once inSuperclass.