-
-
Notifications
You must be signed in to change notification settings - Fork 695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add maps concept #2914
base: main
Are you sure you want to change the base?
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: number of
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kahgoh, a very complete explanation and well-written exercise!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
|
||
public class DialingCodes { | ||
|
||
private final Map<Integer, String> countryByDialingCode = new HashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! I'll remove it from the stub and update the hints.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @manumafe98. Students have already defined a list in a previous learning exercise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very easy to understand explanation on the hash
value. Good work!!
Add maps concept
Resolves #2583
Reviewer Resources:
Track Policies