Search:

Type: Posts; User: jasonm

Search: Search took 0.10 seconds.

  1. Thread: Array help

    by jasonm
    Replies
    11
    Views
    3,001

    Re: Array help

    /**
    * Returns the number of floats in this list.
    * @return the number of floats.
    */
    public int countFloats() {
    for (int i=0; i<n; ++i)
    // TODO: implement this method.
    ...
  2. Thread: Array help

    by jasonm
    Replies
    11
    Views
    3,001

    Re: Array help

    What type is a? Is it the float array that belongs to FloatList? Java arrays are objects. I could be wrong, but I don't think they have an append() method. Could you provide the actual error...
  3. Thread: Array help

    by jasonm
    Replies
    11
    Views
    3,001

    Re: Array help

    Primitives are simple data types, built into to Java language, and just hold a particular kind of value - they don't have methods. You can read about all of the primitives here. So, "float" is a...
  4. Thread: Array help

    by jasonm
    Replies
    11
    Views
    3,001

    Re: Array help

    What I am trying to get you to do is show me how you expect your class to work, as well as how it is working now. Without being able to do this, how do you know if your code is right or wrong?
    ...
  5. Thread: Array help

    by jasonm
    Replies
    11
    Views
    3,001

    Re: Array help

    Okay, so now what do you expect to happen when you run this, and what actually happens? For simplicity, maybe change your example to eliminate the randomness (in the for(...) loop) for the time...
  6. Thread: Array help

    by jasonm
    Replies
    11
    Views
    3,001

    Re: Array help

    Can you provide an example using your FloatList? Indicate what you expect to happen as well as what actually happens. That should provide a good starting point for getting this coded up.
Results 1 to 6 of 6