Skip to content

Instantly share code, notes, and snippets.

@sax1johno
Created September 18, 2015 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sax1johno/94721cdd67ebba9ad298 to your computer and use it in GitHub Desktop.
Save sax1johno/94721cdd67ebba9ad298 to your computer and use it in GitHub Desktop.
// Contact.java
public class Contact {
private String email;
private String name;
private String telephone;
/** ... getters and setters in here **/
}
// Main.java
public class Main {
String[] emails;
String[] telephones;
String[] names;
ArrayList<Contact> contacts;
/** somewhere in the class **/
// ...
for (int i = 0; i < name.size; i++) {
Contact c = new Contact();
c.setName(names[i])
.setTelephone(telephones[i])
.setEmail(emails[i]);
contacts.push(c);
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment