How can I load an array using loadClass method?
String className = "Customer[]";
Thread.currentThread().getContextClassLoader().loadClass(className);
You don't. You do not load the array class, just the class of the underlying type. The JVM will synthesize the array class when required.
new Customer[...] if you can, otherwise java.lang.reflect.Arrays.
loadClassmethod or load the array's class. If it's the latter, is there any reason you wouldn't use theClass.forName()method?