Skip to content

Commit 235a13e

Browse files
kadrisamuelkahgohjagdish-15
authored
Fix about & introduction in International Calling Connoisseur (#2917)
- Remove redundant "studentScores", which seems to be there by mistake. - Fix broken links to keySet and values methods. - Fix references to keySet (should be keySet, not keys). - Fix spacing for alignment in examples. --------- Co-authored-by: Kah Goh <[email protected]> Co-authored-by: jagdish-15 <[email protected]>
1 parent 81aa061 commit 235a13e

File tree

3 files changed

+22
-16
lines changed

3 files changed

+22
-16
lines changed

concepts/maps/about.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ fruitPrices.get("apple"); // => 100
5151
Use [containsKey][map-containskey-javadoc] to see if the map contains a particular key.
5252

5353
```java
54-
fruitPrices.containsKey("apple"); // => true
54+
fruitPrices.containsKey("apple"); // => true
5555
fruitPrices.containsKey("orange"); // => false
5656
```
5757

5858
Remove entries with [remove][map-remove-javadoc].
5959

6060
```java
61-
fruitPrices.put("plum", 90); // Add plum to map
62-
fruitPrices.remove("plum"); // Removes plum from map
61+
fruitPrices.put("plum", 90); // Add plum to map
62+
fruitPrices.remove("plum"); // Removes plum from map
6363
```
6464

6565
The [size][map-size-javadoc] method returns the number of entries.
@@ -68,10 +68,10 @@ The [size][map-size-javadoc] method returns the number of entries.
6868
fruitPrices.size(); // Returns 2
6969
```
7070

71-
You can use the [keys] or [values] methods to obtain the keys or the values in a Map as a Set or collection respectively.
71+
You can use the [keySet][map-keyset-javadoc] or [values][map-values-javadoc] methods to obtain the keys or the values in a Map as a Set or collection respectively.
7272

7373
```java
74-
fruitPrices.keys(); // Returns "apple" and "pear" in a set
74+
fruitPrices.keySet(); // Returns "apple" and "pear" in a set
7575
fruitPrices.values(); // Returns 100 and 80, in a Collection
7676
```
7777

@@ -169,3 +169,5 @@ Calling methods like `put`, `remove` or `clear` results in an `UnsupportedOperat
169169
[map-copyof-javadoc]: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Map.html#copyOf(java.util.Map)
170170
[object-hashcode-javadoc]: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#hashCode()
171171
[object-equals-javadoc]: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)
172+
[map-keyset-javadoc]: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Map.html#keySet()
173+
[map-values-javadoc]: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Map.html#values()

concepts/maps/introduction.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ fruitPrices.get("apple"); // => 100
3737
Use [containsKey][map-containskey-javadoc] to see if the map contains a particular key.
3838

3939
```java
40-
fruitPrices.containsKey("apple"); // => true
40+
fruitPrices.containsKey("apple"); // => true
4141
fruitPrices.containsKey("orange"); // => false
4242
```
4343

4444
Remove entries with [remove][map-remove-javadoc].
4545

4646
```java
47-
fruitPrices.put("plum", 90); // Add plum to map
48-
fruitPrices.remove("plum"); // Removes plum from map
47+
fruitPrices.put("plum", 90); // Add plum to map
48+
fruitPrices.remove("plum"); // Removes plum from map
4949
```
5050

5151
The [size][map-size-javadoc] method returns the number of entries.
@@ -54,10 +54,10 @@ The [size][map-size-javadoc] method returns the number of entries.
5454
fruitPrices.size(); // Returns 2
5555
```
5656

57-
You can use the [keys] or [values] methods to obtain the keys or the values in a Map as a Set or collection respectively.studentScores
57+
You can use the [keySet][map-keyset-javadoc] or [values][map-values-javadoc] methods to obtain the keys or the values in a Map as a Set or collection respectively.
5858

5959
```java
60-
fruitPrices.keys(); // Returns "apple" and "pear" in a set
60+
fruitPrices.keySet(); // Returns "apple" and "pear" in a set
6161
fruitPrices.values(); // Returns 100 and 80, in a Collection
6262
```
6363

@@ -68,3 +68,5 @@ fruitPrices.values(); // Returns 100 and 80, in a Collection
6868
[map-containskey-javadoc]: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Map.html#containsKey(java.lang.Object)
6969
[map-remove-javadoc]: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Map.html#remove(java.lang.Object)
7070
[map-size-javadoc]: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Map.html#size()
71+
[map-keyset-javadoc]: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Map.html#keySet()
72+
[map-values-javadoc]: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Map.html#values()

exercises/concept/international-calling-connoisseur/.docs/introduction.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ fruitPrices.get("apple"); // => 100
3939
Use [containsKey][map-containskey-javadoc] to see if the map contains a particular key.
4040

4141
```java
42-
fruitPrices.containsKey("apple"); // => true
43-
fruitPrices.containsKey("orange"); // => false
42+
fruitPrices.containsKey("apple"); // => true
43+
fruitPrices.containsKey("orange"); // => false
4444
```
4545

4646
Remove entries with [remove][map-remove-javadoc].
4747

4848
```java
49-
fruitPrices.put("plum", 90); // Add plum to map
50-
fruitPrices.remove("plum"); // Removes plum from map
49+
fruitPrices.put("plum", 90); // Add plum to map
50+
fruitPrices.remove("plum"); // Removes plum from map
5151
```
5252

5353
The [size][map-size-javadoc] method returns the number of entries.
@@ -56,10 +56,10 @@ The [size][map-size-javadoc] method returns the number of entries.
5656
fruitPrices.size(); // Returns 2
5757
```
5858

59-
You can use the [keys] or [values] methods to obtain the keys or the values in a Map as a Set or collection respectively.studentScores
59+
You can use the [keySet][map-keyset-javadoc] or [values][map-values-javadoc] methods to obtain the keys or the values in a Map as a Set or collection respectively.
6060

6161
```java
62-
fruitPrices.keys(); // Returns "apple" and "pear" in a set
62+
fruitPrices.keySet(); // Returns "apple" and "pear" in a set
6363
fruitPrices.values(); // Returns 100 and 80, in a Collection
6464
```
6565

@@ -70,3 +70,5 @@ fruitPrices.values(); // Returns 100 and 80, in a Collection
7070
[map-containskey-javadoc]: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Map.html#containsKey(java.lang.Object)
7171
[map-remove-javadoc]: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Map.html#remove(java.lang.Object)
7272
[map-size-javadoc]: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Map.html#size()
73+
[map-keyset-javadoc]: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Map.html#keySet()
74+
[map-values-javadoc]: https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Map.html#values()

0 commit comments

Comments
 (0)