Can somebody tell me how i combine this to classes then make a client?
The class PhoneBook is gonna use methods from linked list class. Just show me example how to combine and how to use methods from linked list class.
public class EntryNumber implements Comparable<EntryNumber> {
private String number, name;
public EntryNumber(){
this("", "");
}
public EntryNumber(String number, String name){
setNumber(number);
setName(name);
}
public String getNumber(){
return number;
}
public String getName(){
return name;
}
public void setNumber(String number){
this.number = number;
}
public void setName(String name){
this.name = name;
}
public String toString(){
return number.toString() + name.toString();
}
public boolean equals(Object obj){
return getNumber().equals(((EntryNumber) obj).getNumber());
}
@Override
public int compareTo(EntryNumber number) {
return getNumber().compareTo(number.getNumber());
}
public class PhoneBook {
private List<EntryNumber> b;
public PhoneBook(){
}
public void insert(EntryNumber number) {
}
public void insert(String number, String name){
}
public String findNumber(String number){
return number;
}
public String findName(String name){
return name;
}
public boolean remove(EntryNumber entrynumber){
}
public List<EntryNumber> getAll(){
}
public int numberOfNumbers(){
}
public String toString(){
return b.toString();
}
}