How can I see in Java if an Object is an array without using reflection? And how can I iterate through all items without using reflection?
I use Google GWT so I am n
You can use Class.isArray()
Class.isArray()
public static boolean isArray(Object obj) { return obj!=null && obj.getClass().isArray(); }
This works for both object and primitive type arrays.
For toString take a look at Arrays.toString. You'll have to check the array type and call the appropriate toString method.
Arrays.toString
toString