Let's say I run on a for with i from 0 to 6, each run in the for I initialize a class that gets as a parameter a name, ex:
ClassThing[] a = new ClassThing[6];
for (int i=0;i<6;i++)
{
a[i] = ClassThing( "hello" );
}
So I want each cell to have it's name by the order, a[0].name will be 0, a[1].name will be 1 and on.
How do I use i variable for this?
Thanks.
You should try something like:
as said before, you can either use
or
or any other mentioned way;