I have an anonymous inner class inside another class (SomeClass
).
Both SomeClass.class.getClasses()
and SomeClass.class.getDeclaredClasses()
return empty arrays.
I couldn't find some hints on this in Class
' Javadocs.
Can anonymous inner classes be retrieved using reflection in some way?
What else are notable differences between anonymous inner classes and normal inner classes?
You could try a brute force search of Class$1 ... Class$n until you can't find any more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With