Jump to content

Recent Status Updates

  • Photo
      15 Nov

    Hi, I am final year Interior Design Student from University of Huddersfield. I am currently working on my final major project which is going to be linked to coding. I was hoping that you could help me with my research. I have prepared a short survey, it would be a massive help if you could fill it in for me. It takes less than 2 minutes to complete, I promise. Here is the link: https://www.surveymonkey.com/s/73XLJKK Thank you so much in advance!

View All Updates

Developed by TechBiz Xccelerator
- - - - -

Strings not being added to arraylist

string array

  • Please log in to reply
3 replies to this topic

#1 noel222


    CC Regular

  • Member
  • PipPipPip
  • 25 posts

Posted 10 February 2012 - 12:54 PM

nevermind I figured it out

Edited by noel222, 10 February 2012 - 02:27 PM.

  • 0

#2 gregwarner


    Obi Wan of Programming

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1,583 posts
  • Location:Arkansas
  • Programming Language:C, Java, C++, C#, PHP, Transact-SQL

Posted 10 February 2012 - 01:20 PM

Your ArrayList is of type Player, not String, so it would contain Player objects, not String objects. Still, I don't think that's quite what you meant. How are you testing to see whether the players are in the ArrayList? I need to see more code to know what's going on.
  • 0

Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid

#3 noel222


    CC Regular

  • Member
  • PipPipPip
  • 25 posts

Posted 10 February 2012 - 01:21 PM

that is all the code I have so far. I am using the contains method to see if the array list contains the players and their nicknames.
  • 0

#4 Norm


    CC Addict

  • Senior Member
  • PipPipPipPipPip
  • 397 posts
  • Location:Eastern Florida
  • Programming Language:Java, C++, Assembly

Posted 10 February 2012 - 02:30 PM

Cross posted at: Strings not being added to arraylist
  • 0

Also tagged with one or more of these keywords: string, array

Powered by binpress