I am trying to unpack the resulting array from the reflection of the fields of the objects. I set the value of the general field to Object. If it is an Array, I want to pass my shared object to an array (regardless of its type) and extract its contents
fields[i].setAccessible(true); String key = fields[i].getName(); Object value = fields[i].get(obj); if (value.getClass().isArray()){ unpackArray(value); }
In my unpackArray method, I tried pouring the value of Object into java.util.Arrays, java.reflect.Array and Array [], but every time it does not allow me.
Is there a way I can pass my object to a shared array?
Many thanks Sam
Sam palmer
source share