Originally Posted by
BlackShadow
Here is code 1 without the main:
public class StatsArrayTester
{
public static void main (String[] args)
{
Scanner scanner = new Scanner(System.in);
StatsArray stats = new StatsArray(); //stats object
System.out.println("Welcome to our StatsArray\n");
StatsArray storage = new StatsArray();
stats.setValue(5, 34);
System.out.println(" GIVE ME SOME VALUE!!! " + stats.getValue(6));
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 index that you set.
And please wrap your code with highlight tags.