this is where the compiler is having issues...
In the future, it's best to show the exact issues that the compiler is having. But in this case it's easy to see that your statement is missing a keyword...
I would use an ArrayList or LinkedList of "Team"s, set the team's information first, and then add the team to the ArrayList. This way if you want to ever add information to the team and, consequently, the array it doesn't cause trouble later....
Someone with more experience might be able to better help you.
David Newton wrote:You have an array that can reference Teams, set to a size, but you don't actually have any Teams.
That's actually what I am trying to do on line 34, is to assign the first element of the first team. Do I need to set all the teams to some default value or something and then assign them? How do I assign them all an initial default value of say: "" and 0?
David Newton wrote:But you don't have a Team to set properties on. You have an array of Team references, but no Teams.
isn't that what the "new" keyword is going on line 62? What if in the Team Constructor method, I put:
. Would that initialize all the teams so I don't get null pointer errors later?
John de Michele wrote:Jim:
Sorry, you're just creating the array with that new. You need to instantiate each element of an array individually, and no, setting the parameters won't change that.
Thanks, gang. I figured it out. The Constructor method required arguments. Once I removed that requirement, I was able to create a loop to instantiate it just fine...