title: ArrayList<Contact> toString()
body: <p>I'm simulating a PhoneBook where i have an <code>ArrayList&lt;Contact&gt;</code>. How to overide the <code>toString()</code> function in order to have some thing like this wen doing <code>System.out.println(phonebook)</code>?</p>
  
  <p><code>Name: name1; Number: number1;
  Name: name2; Number: number2;
  Name: name3; Number: number3;
  etc.....</code></p>
  
  <p>This worked: </p>
  
  <p><code>public String toString() { 
  String phoneBookString = "";
  for(Contact contact : list) { phoneBookString += contact.toString() + "\n"; } 
  return phoneBookString; }</code></p>