Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hi guys, I am in week 9 (Exercise 24) from the MOOC course and I want to know how the else statement change the output... For instance:
- public void add(String word, String entry) {
- if(!this.dictionary.containsKey(word)){
- this.dictionary.put(word, new HashSet<String>());
- }
- else{
- this.dictionary.get(word).add(entry);
- }
- }
- Output:
- [spruce]
- null
- Version 2: (not "else")
- [six, spruce]
- null
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement