I'm trying to use reflection to call a method that takes in a byte array.
I'm starting off doing:
Class myClass = anObject.getClass();
Class[] parameterTypes =
{byte[].getClass();};
But that doesn't work (class expected, } expected) on the byte[] line. Anyone know what I should do? Cast to an Object and declare that the method takes an Object?
Try this:
Class[] parameterTypes = new Class[] {byte[].class};
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