D
deegoogle
Hi,
I have an array of Strings:
String[] somePrimitives = {"int", "char", "void" };
I want to achieve the equivalent of :
for(int i = 0; i < somePrimitives.length; i++) {
Class myClass = Class.forName(somePrimitives); //Wont work
}
We all know, we cannot do Class.forName("int") etc since "int" is not a path to
an actual class - whereas Class.forName("java.lang.Integer") will work.
Can anyone tell me how to achieve the above ?
thanks.
I have an array of Strings:
String[] somePrimitives = {"int", "char", "void" };
I want to achieve the equivalent of :
for(int i = 0; i < somePrimitives.length; i++) {
Class myClass = Class.forName(somePrimitives); //Wont work
}
We all know, we cannot do Class.forName("int") etc since "int" is not a path to
an actual class - whereas Class.forName("java.lang.Integer") will work.
Can anyone tell me how to achieve the above ?
thanks.