Is this possible to do? I am looking to parse some data out of a file and based on the results of this take names found in the file and create objects out of them. for example...
//you have parsed the name Bob out of a file and it is stored in an array of Strings at location 1.
public static String[] parsedPlayers = {"Bill", "Bob", "Joe", "Jane", "Jill"};
//Now what i want to do is use the names above as variable names and pass them as arguments to the constructor, but i dont know how to create a variable out of them.
Player XXXXXX = new Player(XXXXXX);
//constructor
public Player(String name) {
playerName = name;
immunities = immunityNames;
}
Anyone know how i would go about doing this?
My teacher mentioned something about introspection when i asked him, but my research has been futile and i have not seen any methods that would help me with this.
TJ