Given a Class<?>
that describes class A
, is it somehow possible to get the Class<?>
that matches the class A[]
?
Class<?> clazz = A.class;
Class<?> arrayclazz = clazz.toArray(); // ??
assert arrayclazz.equals(A[].class);
Given a Class<?>
that describes class A
, is it somehow possible to get the Class<?>
that matches the class A[]
?
Class<?> clazz = A.class;
Class<?> arrayclazz = clazz.toArray(); // ??
assert arrayclazz.equals(A[].class);
java.lang.reflect.Array.newInstance(clazz, 0).getClass()
use A[].class
. I hope this help.