Your AddScores() method returns an ArrayList of that contains a bunch of Doubles.
If you call ArrayList's .toArray() method it will
return you an Array of doubles.
On line 8 (the one giving you errors) you are not using the toArray method correctly.
The toArray method does not take any parameters and yet you're passing it something.
Why are you doing this?
And what are you doing on line 5?
You should:
- retrieve the ArrayList by calling the AddScores() method.
- declare an array of doubles
- retrieve the array of doubles by calling the ArrayList's .toArray() method.
For example (may not work):
-
double[] theScores = AddScores().toArray();
-
//The AddScores method returns an ArrayList.
-
//In the above code I am calling the toArray() method
-
//on the ArrayList returned by the AddScores() method.
-
//The toArray() method returns an Array of all of the items
-
//in the ArrayList.
-
//This means that the toArray method will return an
-
//array of doubles......
-
-Frinny