I purchased the Head First
Java And i am into the array list topic already. There's an example named class DotCom where the author used private ArrayList<
String> locationCells.
I tried the program but it came up with an error. Please tell me what i generated the ff error: setLocations(java.util.ArrayList<java.lang.Integer>
i DotCome cannot be applied to (int [] )
newGame.setLocations(locations);
Here's the code:
I really think that the error is code int [] locations = { randomNum, randomNum + 1, randomNum + 2 }; because it's an integer and the arguments at the array list is a String.
Please help. Thanks!