stats.setValue(5, 34);
System.out.println(" GIVE ME SOME VALUE!!! " + stats.getValue(6));
You set the value 34 in stats[5] but then you print stats[6] which is 0. You should print the same stats...
Type: Posts; User: andreas90
stats.setValue(5, 34);
System.out.println(" GIVE ME SOME VALUE!!! " + stats.getValue(6));
You set the value 34 in stats[5] but then you print stats[6] which is 0. You should print the same stats...
I tried it and it works properly.
Can you post the exact code of both classes that gives you 0.
The above code assigns stats[position] to value. You need the opposite, assign value to stats[position]
Hello BlackShadow!
If i understood well, you only want to set and get a value in a specified position of your stats array. In your setValue(int position, int value) method you don't need a loop. You...