Okay so I have the following piece of code:
Random rnd = new Random();
int i = 0;
while(i<1000) {
String name = "event" + i;
Event name = new Event(rnd.nextInt(100000)); //ERROR duplicate variable
SimEngine.getScheduler().addEventToQueue(event);
i++;
}
System.out.println(SimEngine.getScheduler().getQueue().iterator());
I know that declaring name twice makes no sense, but I hope you can see what I'm trying to do. Because I want Event objects with names event1, event2 ,event3 etc.
How can I get it to let me use the String name as the name of the Event object?