@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...
Type: Posts; User: copeg
@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...
See my signature: Short, self contained, correct, compilable example
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") ){
}
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...
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...