Yesoda Sanka c52be53626 part2 implemented | 6 vuotta sitten | |
---|---|---|
src | 6 vuotta sitten | |
.gitignore | 6 vuotta sitten | |
PhoneBookUML.png | 6 vuotta sitten | |
README.md | 6 vuotta sitten | |
pom.xml | 6 vuotta sitten |
PhoneBook
classPhoneBook
class that holds names and phone numbers.Hint: You should use a sorted map.
Your PhoneBook class should have the following method
add(String name, String phoneNumber)
na
remove(String name)
reverseLookup(String phoneNumber)
phoneNumber
listNamesAndNumbers()
1 * Format should be [name] [phone number]
PhoneBook phoneBook = new PhoneBook();
phoneBook.add("Zebra", "111-222-333");
phoneBook.add("Dog", "222-444-4444");
phoneBook.listNamesAndNumbers();
```
Zebra 111-222-333
```Dog 222-444-4444
PhoneBook
class to map names to lists of phone numbers.add()
and remove()
methods to handle adding or removing individual numbersremoveRecord
method for removing an entire entry from your PhoneBook.