Add maps concept#2914
Conversation
concepts/maps/about.md
Outdated
| It is similar to dictionaries in other programming languages. | ||
| The [Map][map-javadoc] interface defines operations on a map. | ||
|
|
||
| Java has a number Map implementations. |
josealonso
left a comment
There was a problem hiding this comment.
@kahgoh, a very complete explanation and well-written exercise!
manumafe98
left a comment
There was a problem hiding this comment.
Good job! @kahgoh this one will be very useful to the students of exercism!
exercises/concept/international-calling-connoisseur/.docs/instructions.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Manuel Maxera <95315128+manumafe98@users.noreply.github.com>
|
|
||
| public class DialingCodes { | ||
|
|
||
| private final Map<Integer, String> countryByDialingCode = new HashMap<>(); |
There was a problem hiding this comment.
@manumafe98 I'm wondering whether I should remove this? I had originally put this here to make it clearer where the Map is defined, but then again classes is set as a prerequisite (so students could probably work out to define a field). I would add a hint if removed.
Another might option is to replace this with something like:
// TODO: Make a Map instance
private final Map<Integer, String> countryByDialingCode = null;Do you have any thoughts on what we should do here?
There was a problem hiding this comment.
Yeah I will remove it too, I think if they reach this part of the track they should know were to define it.
And also it give us leverage to work on an extra actionable if for example a student does something like this
public Map<Integer, String> getCodes() {
Map<Integer, String> countryByDialingCode = new HashMap<>();
return Map.copyOf(countryByDialingCode);
}To check that they initialize the map as a field and not inside the methods
There was a problem hiding this comment.
Cool! I'll remove it from the stub and update the hints.
There was a problem hiding this comment.
I agree with @manumafe98. Students have already defined a list in a previous learning exercise.
josealonso
left a comment
There was a problem hiding this comment.
Very easy to understand explanation on the hash value. Good work!!
|
@manumafe98, I added a commit since you approved. Just wanted to check if it looks good to you before merging. |
Add maps concept
Resolves #2583
Reviewer Resources:
Track Policies