Search:

Type: Posts; User: andreas90

Search: Search took 0.09 seconds.

  1. Re: Needing some help with array getter and setter methods!!

    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...
  2. Re: Needing some help with array getter and setter methods!!

    I tried it and it works properly.
    Can you post the exact code of both classes that gives you 0.
  3. Re: Needing some help with array getter and setter methods!!

    The above code assigns stats[position] to value. You need the opposite, assign value to stats[position]
  4. Re: Needing some help with array getter and setter methods!!

    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...
Results 1 to 4 of 4