I have a method that needs a Object.class parameter like
method(Object.class)
How can I set the class to an Array of this class? Something like
method(ArrayList<Object>.class)
I tried
method(new ArrayList<Object>() {})
as well. It doesnt work.
You can use Object[].class
.
(int[].class
, String[].class
, double[][][].class
etc also works for that matter.)
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