Hi all,
I am trying to get a certain element of my ArrayList to an int:
|
Code:
|
ArrayList cities = new ArrayList<Integer>();
while (cities.size() != 0) { //while not null (ATM it will always be null till finished writing the loop)
int s = 0;
int one = cities.get(d); //this is where I get the error
cities.add(s,"x");
System.out.println("___________");
System.out.println(cities.get(s));
} |
I get an error: Found Object, required int
(
Please note that there may be problems with my loops (its not finished yet) All i need to know is how to get the element d or even element 0 or 1 to save as type int in variable "one"
Any thoughts?
Thanks!