Search:

Type: Posts; User: jps

Search: Search took 0.10 seconds.

  1. Thread: acessing ArrayList

    by jps
    Replies
    14
    Views
    2,017

    Re: acessing ArrayList

    Any time you make changes to the code, post the new code with your question so that everyone is looking at the same code.
  2. Thread: acessing ArrayList

    by jps
    Replies
    14
    Views
    2,017

    Re: acessing ArrayList

    Did you try to println the variables and see which one(s) are null?
    If you need more help you will need to post the code and error messages.
  3. Thread: acessing ArrayList

    by jps
    Replies
    14
    Views
    2,017

    Re: acessing ArrayList

    Did you try it? Did it work?
  4. Thread: acessing ArrayList

    by jps
    Replies
    14
    Views
    2,017

    Re: acessing ArrayList

    Yes. Also search "primitive types wrapper classes"



    Think about how to solve the problem in terms of solving the problem before thinking in terms of code. Organize a list of steps into a step...
  5. Thread: acessing ArrayList

    by jps
    Replies
    14
    Views
    2,017

    Re: acessing ArrayList

    Originally the code used an ArrayList. Now the code shown here uses an array. Just to be clear, an ArrayList can be declared with a type.



    Any type of variable declared inside the loop will...
  6. Thread: acessing ArrayList

    by jps
    Replies
    14
    Views
    2,017

    Re: acessing ArrayList

    Understood. Why is this inside an if statement as a stand alone unit. if ((floors[i]=floor) && (etc) && (etc) ) {
    It just looks to add confusion to what the code is to accomplish. I would rather see...
  7. Thread: acessing ArrayList

    by jps
    Replies
    14
    Views
    2,017

    Re: acessing ArrayList

    Does this do what you wanted? Did you want to compare floors[i] to floor, or set floors[i] to floor?


    The same way you access an element in any list.
    myListName[indexNumberOfElementNeeded]
    just...
Results 1 to 7 of 7