I was just trying to show someone something using reflection to make my point and I've run into a snag. I wanted to list
all of the fields contained by a class - that would include the fields declared within that class and the fields inherited by that class. This is what I wrote:
Obviously, I'm only getting the public fields contained by Child. Certainly, that's exactly what the API Spec says it does, but it's not what I'm after. Instead, I really want all fields contained by Child - that should include one, two, four, five, and six.
I've also looked at using getDeclaredFields(), but that only returns the fields declared within Child and skips those that are inherited from Parent. Is there any way to get that information?
Thanks,
Corey