I have a method that receives an array of strings and I need to create objects with appropriate names.
For example:
public class temp {
public static void main(String[] args){
String[] a=new String[3];
a[0]="first";
a[1]="second";
a[2]="third";
createObjects(a);
}
public static void createObjects(String[] s)
{
//I want to have integers with same names
int s[0],s[1],s[2];
}
}
If I receive ("one","two") I must create:
Object one;
Object two;
If I receive ("boy","girl") I must create:
Object boy;
Object girl;
Any help would be appreciated.