Hi,
I have a small doubt in Java Reflection.
I pass in the name of a java class and a value(in byte[]) of that type as arguments to a function.
I want my function to create an object to that class and intiailise it with that value that is passed as an argument.
How do I achieve this?
now how do I change the byte array's value and initialise my object.
Any help would be greatly appreciated.
thanks.
I have a small doubt in Java Reflection.
I pass in the name of a java class and a value(in byte[]) of that type as arguments to a function.
I want my function to create an object to that class and intiailise it with that value that is passed as an argument.
How do I achieve this?
Code:
suppose I has passed arguments: java.lang.String, byte[]"Sample String"
Object obj = Class.forName("java.lang.String").newInstance();
now how do I change the byte array's value and initialise my object.
Any help would be greatly appreciated.
thanks.