I want to iterate through items in an arraylist of objects, with an index as well, so that I can transfer a string (part of object/class) into an ArrayList<String>
My code:
for(PeopleDetails person : people_list; /*not using termination, will terminate at end of people_list */ ;i++){
/// Code here
}
However I get an error, saying :
Type mismatch: cannot convert from ArrayList<PeopleDetails> to PeopleDetails
.
What causes this error ? Thanks for the help!!