Search:

Type: Posts; User: copeg

Search: Search took 0.09 seconds.

  1. Replies
    30
    Views
    4,498

    Re: Strings not being added to arraylist

    @noel222, thanks for wasting our time. Please read http://www.javaprogrammingforums.com/cafe/6776-problems-cross-posting.html

    And 2 infractions in a single week - you are working your way to being...
  2. Replies
    30
    Views
    4,498

    Re: Strings not being added to arraylist

    See my signature: Short, self contained, correct, compilable example
  3. Replies
    30
    Views
    4,498

    Re: Strings not being added to arraylist

    From post #7


    I see nothing in your first post that uses the contains method. If you are using it like this


    if ( teamRoster.contains("Mark") ){

    }
  4. Replies
    30
    Views
    4,498

    Re: Strings not being added to arraylist

    Read my post above...the ArrayList does not contain Strings - it contains players. If you are using contains() to check for the presence of a String, you will always get false. But I can only guess...
  5. Replies
    30
    Views
    4,498

    Re: Strings not being added to arraylist

    Nowhere in your code do I see a String being added to an ArrayList - I do see instances of Player. If you want to retrieve a Player based upon name, loop over the List and check for the name, or use...
Results 1 to 5 of 5