Hi This is my first post on this forum, so first I would like to say Hi!
I have created a loop that returns a contact object by surName that is held in a contact list.
public Contact print(String surName) { for(Contact contact : contacts) { if(surName.equals(contact.surName)) { contact.print(); } } //no match return null; }
What I am trying to do now is return the details of the contact object and print them out as String or as Print method. Any ideas please?