This question is derived from: How to get this Method object via reflection?
I'm trying to do the following:
Class c1 = Class.forName("[Ljava.lang.Integer;"); // works fine
Class c1 = Class.forName("[Lint;"); // doesn't work, since it's primitive
What is the workaround? int[].class
is the only solution?
Class c1 = Class.forName("[I");
See javadoc of Class.getName()
for details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With