Search:

Type: Posts; User: Norm

Search: Search took 0.10 seconds.

  1. Replies
    30
    Views
    4,514

    Re: Strings not being added to arraylist

    Cross posted at Strings not being added to arraylist
  2. Replies
    30
    Views
    4,514

    Re: Strings not being added to arraylist

    That code will not compile. For example: No class or import statements. The variable: team is not defined.
    Please post a complete program that will compile and execute.
  3. Replies
    30
    Views
    4,514

    Re: Strings not being added to arraylist

    There is no space in the code you posted.
    There is a space in this: tR= filename@4e82710e

    Explain that please!
  4. Replies
    30
    Views
    4,514

    Re: Strings not being added to arraylist

    As copeg suggests: post an SSCCE which will more clearly demonstrate the problem.
  5. Replies
    30
    Views
    4,514

    Re: Strings not being added to arraylist

    There is no space in the code you posted.
    There is a space in this: tR= filename@4e82710e

    Explain that please!

    Does the teamRoster class object have a toString() method that returns that...
  6. Replies
    30
    Views
    4,514

    Re: Strings not being added to arraylist

    Can you post the println statement that printed this: tR= filename@4e82710e
  7. Replies
    30
    Views
    4,514

    Re: Strings not being added to arraylist

    If teamRoster was a ArrayList the output would look like this:


    class Testing {}
    ArrayList<Testing> al = new ArrayList<Testing>();
    al.add(new Testing());
    al.add(new...
  8. Replies
    30
    Views
    4,514

    Re: Strings not being added to arraylist

    That says that the teamRoster variable is a filename class object, NOT an arraylist. Do you have a class named: filename?
    You need to post the definition for the teamRoster variable whose add()...
  9. Replies
    30
    Views
    4,514

    Re: Strings not being added to arraylist

    That says that the teamRoster variable is a filename class object, NOT an arraylist. Do you have a class named: filename?
    You need to post the definition for the teamRoster variable whose add()...
  10. Replies
    30
    Views
    4,514

    Re: Strings not being added to arraylist

    Did you try what I just posted to see what was in the arraylists?
    Add a println() call immediately after the code that adds to the arraylist:


    ...
    teamRoster.add(new Player("Keith", "The...
  11. Replies
    30
    Views
    4,514

    Re: Strings not being added to arraylist

    What is printed out when you use println to print it?

    Add a println() call immediately after the code that adds to the arraylist:


    ...
    teamRoster.add(new Player("Keith", "The Man"));...
  12. Replies
    30
    Views
    4,514

    Re: Strings not being added to arraylist

    Have you tried printing out the contents of the arraylist to see if it contains anything?
  13. Replies
    30
    Views
    4,514

    Re: Strings not being added to arraylist

    How are you detecting what the arraylist contains or does not contains?

    Your bits and pieces of code do not show enough to make suggestions about what the problem is.
Results 1 to 13 of 13