Cross posted at Strings not being added to arraylist
Type: Posts; User: Norm
Cross posted at 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.
There is no space in the code you posted.
There is a space in this: tR= filename@4e82710e
Explain that please!
As copeg suggests: post an SSCCE which will more clearly demonstrate the problem.
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...
Can you post the println statement that printed this: tR= filename@4e82710e
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...
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()...
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()...
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...
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"));...
Have you tried printing out the contents of the arraylist to see if it contains anything?
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.