I am really stumped with my code:
I have a static class:
static class Test
{
static b;
static c;
}
and in my main class, I have initialized an array of static Test.
Test[] AB = new Test[5];
I then fill the array with:
for(int a=0; a<AB.length; a++)
{
int C = new int();
int D = new int();
C = get user input here....
D = get user input here...
AB[a].c = C;
AB[a].b = D;
}
When I output the array, all my values are the last values inputted. Basically, if user last inputted C = 5, D = 4. All the values from AB[0] - AB[4] for c and b are 5 and 4.
I'm really stumped.
Can anyone help me with this issue?
Thanks!