title: Iterate over ArrayList in Java?
body: <p>An arraylist contain object of a class. The object contain 3 variable name,city and phonenumber. How to iterate over the arraylist in java.
  is this syntax correct: name of the arraylist is cartdetails.</p>