Image

Imagealistairg wrote in Imagejava_dev

Auto numbering objects

Just a quickie:

I want to create a set of several Objects, all with a name and then a number after them.

For example:

Job1
Job2
Job3
Job4

I've tried using something along the lines of:

Job Job+i = new Job();
Job "Job+1" = new Job();
Job "Job"+i = new Job();

None of which work. Is it not possible to use variables when creating or accessing objects?

Edit: I was being stupid, am using an array of objects now...