Browse Source

Update 'README.md'

nhu313 6 years ago
parent
commit
1697cad159
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      README.md

+ 5
- 3
README.md View File

35
 
35
 
36
 	* `reverseLookup(String phoneNumber)`
36
 	* `reverseLookup(String phoneNumber)`
37
 		* returns a name for the respective input `phoneNumber`
37
 		* returns a name for the respective input `phoneNumber`
38
-	* `display()`
39
-		* print a human-readable list of all entries (names and phone numbers) in alphabetical order.
38
+	* `toString()`
39
+		* return a human-readable list of all entries (names and phone numbers) in alphabetical order.
40
 
40
 
41
 	   * Sample Script
41
 	   * Sample Script
42
 	
42
 	
44
 		   PhoneBook phoneBook = new PhoneBook();
44
 		   PhoneBook phoneBook = new PhoneBook();
45
 		   phoneBook.add("Zebra", "111-222-333");
45
 		   phoneBook.add("Zebra", "111-222-333");
46
 		   phoneBook.add("Dog", "222-444-4444");
46
 		   phoneBook.add("Dog", "222-444-4444");
47
-		   phoneBook.display(); 
47
+		   
48
+           String entries = phoneBook.toString(); 
49
+           System.out.println(entries);
48
 		   ```
50
 		   ```
49
 	
51
 	
50
 	   * Sample Output
52
 	   * Sample Output