One way to get hold of the Class
object for an array type is to call getClass()
on an array instance that you created reflectively; e.g.
Class someClass = Some.class;
Class someArrayClass = java.reflect.Array.newInstance(someClass, 0).getClass();
You can also use Class.forName()
but you need to specify the class name in internal form; e.g. the class name for an Object[]
is "[Ljava.lang.Object;"
. See Class.getName() for details of the class name format.