So when I create an object, I use something like:
Object objectName = new Object();
And I get an object which I can refer to as objectName when calling methods like
objectName.method(parameter);
But how do I make it so I can create an object that I can refer to using a name from a string, something like:
string objectName = "myName";
Object [objectName] = new Object();
And then refer to it like:
myName.method(parameter);
So somehow insert the string objectName into the actual name of the new object. How would I do this?
EDIT: I stumbled across this question in my own profile 5 years (and a CS degree) later, and laughed. The use-case for this was creating objects to store data about locations in a video game world, and I didn't at the time realize that you could have objects without names. The solution I actually would have needed would simply have been an array of objects.