Search:

Type: Posts; User: javapenguin

Search: Search took 0.07 seconds.

  1. Replies
    7
    Views
    1,439

    Re: Randomized array members.

    public class build_array
    {
    private int array_size;
    // private int val1, val2, val3, val4, val5;
    private int[] vals;
    private my_class[] arr;
    // private float val1per, val2per, val3per, val4per,...
  2. Replies
    7
    Views
    1,439

    Re: Randomized array members.

    arr = new my_class[array_size];

    You never defined array_size. You declared it but never gave it a value.

    That also will make an error.

    If you're allowed to, why not pass the array size to...
  3. Replies
    7
    Views
    1,439

    Re: Randomized array members.

    public class build_array(){

    this will make an error.

    You're both trying to define the beginning of a class and making that beginning into a constructor at the same time.

    Lose the () after...
  4. Replies
    7
    Views
    1,439

    Re: Randomized array members.

    If all your values in the array are single characters, make a char array.
Results 1 to 4 of 4