So I'm learning java and I don't know how to use a string as an object name.
For example, let's suppose I have 3 objects not belonging to the same class, but they all have the variables a, b, c. I want a function to modify these variables, depending on the object name I give, which would work like :
public void myFonction(String objectName)
{
objectName.a++; //of course that doesn't word
objectName.b=15;
//ect
}
This must be something extremely simple to do, but what I found on the subject didn't fit this case or I didn't understand :)
instanceof?