I have an array and I need to create an object of Element type for each element of the array. I am in the loop with the problem that you can not give an object a variable as a name so I do not know how to create them since the variable Element would be crushed all the time. Is there any way in java to do this?
I have an array called states and each state has an attribute name. The loop would be the following:
for(int i=0; i<eventos.length; i++) {
Element start = new Element(eventos[i].getNombre(), "20em", "6em");
start.addEndPoint(new BlankEndPoint(EndPointAnchor.BOTTOM));
start.addEndPoint(new BlankEndPoint(EndPointAnchor.LEFT));
}