Z
Z
I am using reflection to getmethod(methodName, Class parameters) and
invoke(object, obj[] parameters) methods from some Objects.
My problem is:
Say: I want to invoke a method that takes String[] object as parameter
(I was able to getmethod correctly). When I try to create an object
(to pass as args to invoke):
Object someObject= (Object) String[].class.newInstance();
(Note that the object is not always an instance of String[]... it
could be an instance of SomeOtherClass[])
I do get the following exception:
java.lang.InstantiationException: [Ljava.lang.String;
My question is:
Does the "[L" at the beginning and the ";" at the end have a meaning?
How can I solve this problem?
I am using IntelliJ 6.0.5.
Thanks in advance.
invoke(object, obj[] parameters) methods from some Objects.
My problem is:
Say: I want to invoke a method that takes String[] object as parameter
(I was able to getmethod correctly). When I try to create an object
(to pass as args to invoke):
Object someObject= (Object) String[].class.newInstance();
(Note that the object is not always an instance of String[]... it
could be an instance of SomeOtherClass[])
I do get the following exception:
java.lang.InstantiationException: [Ljava.lang.String;
My question is:
Does the "[L" at the beginning and the ";" at the end have a meaning?
How can I solve this problem?
I am using IntelliJ 6.0.5.
Thanks in advance.