Phonebook Linked List Java

I want to make a phonebook as a linked list. Next step for me would be to implement a method like public Person[] searchFirstName(String firstName) and store the results in an array. Don’t know how to do that yet, but I try to figure it out.

public class Entry {

public String firstName; public String name; public int tel;   public Entry next;  public Entry(String firstName, String name, int tel) {      this.firstName = firstName;     this.name = name;     this.tel = tel;  }  public void display() {      System.out.println(firstName + name + tel);  }  public String toString() {      return firstName + name + tel; } 

}

public class Main {

public static void main(String[] args) {      Phonebook phonebook = new Phonebook();       phonebook.add("Serena", "Williams", 017644444444);      phonebook.add("Steffi", "Graf", 017644444445);      phonebook.add("Steffi", "Schaf", 017644444446);      phonebook.add("Steffi", "Harf", 017644444447);       phonebook.display();      System.out.println("Value of first in LinkedList " + phonebook.firstEntry + "\n");       phonebook.removeFirst();      phonebook.display();       System.out.println("\nSearching for all Serenas\n");     System.out.println(phonebook.find("Serena").firstName + " Was Found");      phonebook.remove("Serena", "Williams", 017644444444);      System.out.println("\nSerena Williams\n");      phonebook.display();  } 

}

public class Phonebook implements PhonebookInterface {

// Reference to first Entry in list // The last Entry added to the LinkedList  public Entry firstEntry;  Phonebook() {      // Here to show the first Entry always starts as null      firstEntry = null;  }  // Returns true if Phonebook is empty  public boolean isEmpty() {      return (firstEntry == null);  }  public boolean add(String firstName, String name, int tel) {      Entry newEntry = new Entry(firstName, name, tel);      // Connects the firstEntry field to the new Entry      newEntry.next = firstEntry;      firstEntry = newEntry;      return true;  }  public Entry removeFirst() {      Entry entryReference = firstEntry;      if (!isEmpty()) {          // Removes the Entry from the List          firstEntry = firstEntry.next;      } else {          System.out.println("Empty LinkedList");      }      return entryReference;  }  public void display() {      Entry theEntry = firstEntry;      // Start at the reference stored in firstEntry and     // keep getting the references stored in next for     // every Entry until next returns null      while (theEntry != null) {          theEntry.display();          System.out.println("Next Entry: " + theEntry.next);          theEntry = theEntry.next;          System.out.println();      }  }  public Entry find(String firstName) {      Entry theEntry = firstEntry;      if (!isEmpty()) {          while (theEntry.firstName != firstName) {              // Checks if at the end of the LinkedList              if (theEntry.next == null) {                  // Got to the end of the Links in LinkedList                 // without finding a match                  return null;              } else {                  // Found a matching Entry in the LinkedList                  theEntry = theEntry.next;              }          }      } else {          throw new IllegalArgumentException("Empty Phonebook");      }      return theEntry;  }   public boolean remove(String firstName, String name, int tel) {      Entry currentEntry = firstEntry;     Entry previousEntry = firstEntry;      // Keep searching as long as a match isn't made      while (currentEntry.firstName != firstName) {          // Check if at the last Entry in the LinkedList          if (currentEntry.next == null) {              // firstName not found so leave the method              return false;          } else {              // We checked here so let's look in the             // next Entry on the list              previousEntry = currentEntry;              currentEntry = currentEntry.next;          }      }      if (currentEntry == firstEntry) {          // If you are here that means there was a match         // in the reference stored in firstEntry in the         // LinkedList so just assign next to firstEntry          firstEntry = firstEntry.next;      } else {          // If you are here there was a match in a Entry other         // than the firstEntry. Assign the value of next for         // the Entry you want to delete to the Entry that's         // next previously pointed to the reference to remove          System.out.println("FOUND A MATCH");         System.out.println("currentEntry: " + currentEntry);         System.out.println("firstEntry: " + firstEntry);          previousEntry.next = currentEntry.next;      }      return true;  } 

}

public class Person {

private String firstName; private String name; private int tel;  public Person (String firstName, String name, int tel) {     this.firstName = firstName;     this.name = name;     this.tel = tel; }  public void setFirstName(String firstName) {     this.firstName = firstName; }  public void setName(String name) {     this.name = name; }  public void setTel(int tel) {     this.tel = tel; }  public String getFirstName() {     return firstName; }  public String getName() {     return name; }  public int getTel() {     return tel; }  public String toString() {     return firstName + " " + name + ", " + tel; } 

}

public interface PhonebookInterface {

//public abstract int size();  //public abstract Person[] searchFirstName(String firstName);  //public abstract Person[] searchName(String name);  public abstract boolean add(String firstName, String name, int tel);  public abstract boolean remove(String firstName, String name, int tel);  //public abstract Person[] searchFirstName(String firstName); 

}