Skip to content

Conversation

@k1nxx
Copy link

@k1nxx k1nxx commented Apr 4, 2024

No description provided.

@k1nxx k1nxx requested review from a team as code owners April 4, 2024 14:16
@@ -0,0 +1,20 @@
### Hashmaps

With arrays you have to store data in an ordered sequence identified with a indx. `Hashmaps` store data in a (key, pair) sequence that you can access by the index referring to another Object(indx is also an Object)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This misses a pretty needed step of explaining how .equals and .hashCode work. Without that they would make a HashMap<Apple, Apple> and not be primed to understand what is going on.

That or they might have a mutable aggregate as a key.


```java
import java.util.HashMap;
HashMap<Type, Type> Name = new HashMap<Type, Type>();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If its <Type, Type> , that implies that both the keys and the values are the same type? Thats confusing.

map.size();
```

Note: use `keyset()` to only get keys and `values()` to get specific Object values in loops
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This note is silly without a clear example.

**Functions:**

```java
map.put(identifier, value);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The key is not an "identifier", its a key.


```java
map.put(identifier, value);
map.get(identifier);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each of these should rightfully get their own page.

@github-actions
Copy link

github-actions bot commented May 5, 2024

This pull request is stale because it has been open 30 days with no activity. Remove stale label, comment or add the valid label or this will be closed in 5 days.

@github-actions github-actions bot added stale inactivity-closed Issues that have been closed due to inactivity, but are otherwise valid and might be reopened later labels May 5, 2024
@github-actions github-actions bot closed this May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inactivity-closed Issues that have been closed due to inactivity, but are otherwise valid and might be reopened later stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants