Created
July 16, 2020 20:25
-
-
Save nikhilsaraf/eb4f4089a14972b9a65935598db0f51d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
sample code that gets an address book represented by a map | |
usage: | |
map = getAddressBookComplex(); | |
phoneNumber = map.get("Ava"); // (415)-730-xxxx | |
*/ | |
Map<String, String> getAddressBookComplex() { | |
Map<String, String> map = new HashMap<>(); | |
map.put("Ava", "(415)-730-xxxx"); | |
map.put("Bob", "(512)-349-xxxx"); | |
map.put("Carl", "(917)-123-xxxx"); | |
return map; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment