Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.ArrayList;
- public class AddressBook
- {
- private ArrayList<Contact> list;
- private String combinedName;
- private String combinedArrayName;
- public AddressBook() {
- list = new ArrayList<Contact>();
- }
- public void addContact(String first, String last, String email)
- {
- String lastName = last.toUpperCase();
- String firstName = first.toUpperCase();
- combinedName = lastName + firstName;
- for (ArrayList<Contact> list : list) {
- combinedArrayName = this.lastName.toUpperCase() + this.first.toUpperCase();
- if (combinedName.equals(combinedArrayName)) {
- System.out.println("Attepmted to add contact but contact already exists.");
- }
- else {
- System.out.println("Removed");
- }
- }
- }
- public void removeContact(String first, String last)
- {
- }
- public void mergeBooks(AddressBook otherBook)
- {
- }
- public String toString()
- {
- return "String";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement