My class A has
AClaz[] rofl;
The documentation for getDeclaredFields says “This method returns an array of length 0 if the class or interface declares no fields, or if this Class object represents a primitive type, an array class, or void. ”
I want to access the rofl array of type AClaz using reflection. Even if the AClaz is an inner class of class A.
So I would do getDeclaredClass ?
You’re misreading the documentation – it’s talking about calling
getDeclaredFieldson an array class, like this:You should be able to get the field from
Awithout any problem usingand then iterate over the array, or
The fact that the field type is an array is not a problem at all.