Sfoglia il codice sorgente

Update 'README.md'

nhu313 6 anni fa
parent
commit
1697cad159
1 ha cambiato i file con 5 aggiunte e 3 eliminazioni
  1. 5
    3
      README.md

+ 5
- 3
README.md Vedi File

@@ -35,8 +35,8 @@
35 35
 
36 36
 	* `reverseLookup(String phoneNumber)`
37 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 41
 	   * Sample Script
42 42
 	
@@ -44,7 +44,9 @@
44 44
 		   PhoneBook phoneBook = new PhoneBook();
45 45
 		   phoneBook.add("Zebra", "111-222-333");
46 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 52
 	   * Sample Output