Skip to content
Sign upLog in
← Back to Community

wut hashmap in java

Profile icon
MatthewXia

i have no idea y. i hve now ideapo. bafjnafuawf of aau;wf ab;aw b; waoj afw aw

Voters
Profile icon
MatthewXia
Comments
hotnewtop
Profile icon
Coder100

A hashmap is like a dictionary:

import java.util.HashMap; // import the HashMap class HashMap<String, String> myDict = new HashMap<String, String>();

So the first type argument (<String) denotes the value of the key (you can think of it as the word)
The second (, String>) denotes the value (definition)

import java.util.HashMap; // import the HashMap class HashMap<String, String> myDict = new HashMap<String, String>(); // Set some values myDict.put("myWord", "myDefinition"); myDict.put("SomethingElse", "mynewDef"); // Now to get a value: myDict.get("myWord"); // Delete a value: myDict.remove("myWord"); // Delete all values: myDict.clear();
Profile icon
MatthewXia

@Coder100
ok thanks

Profile icon
Coder100

np

@MatthewXia

Profile icon
k9chelsea2
Profile icon
MatthewXia

@k9chelsea2
wut might help?

Profile icon
k9chelsea2

sorry but what do you mean? lol im confused

Profile icon
k9chelsea2

the links i gave explain what hashmap is and how to use it

Profile icon
MatthewXia

@k9chelsea2
what is this this and this?

Profile icon
MatthewXia

@k9chelsea2
there is no"this"

Profile icon
k9chelsea2

links click on them

Profile icon
MatthewXia

@k9chelsea2
cant see the links

Profile icon
MatthewXia

@k9chelsea2
ur comment not there

Profile icon
k9chelsea2

click on the this

Profile icon
MatthewXia

@k9chelsea2
i cant

Profile icon
k9chelsea2

Screen Shot 2020-08-17 at 6.49.05 PM

click on the blue this'

Profile icon
MatthewXia

@k9chelsea2
there is no blue this

Profile icon
MatthewXia

@MatthewXia
yup still no past matthew

Profile icon
MatthewXia

@k9chelsea2
oh i see now

Profile icon
k9chelsea2

ok cool, whenever you see something blue it prolly a link that is achieved by writing a [name of link for example: this] (link url) and then it will output the name of link

Profile icon
k9chelsea2
Profile icon
MatthewXia

@k9chelsea2
but its not blue

Profile icon
MatthewXia

@k9chelsea2
and ik what a prolly link is

Profile icon
k9chelsea2

Screen Shot 2020-08-17 at 7.01.40 PM

this is what my last comment looked like before i posted it

Profile icon
MatthewXia

@k9chelsea2
ok?

Profile icon
MatthewXia

@k9chelsea2
so wut your point

Profile icon
k9chelsea2

no i know you know what a link is lmao, the reason the 'this' on the comment with my first screenshot was not blue was not because i was giving you an example

Profile icon
k9chelsea2

forget it

Profile icon
MatthewXia

@k9chelsea2
ik. it might also be that I broke google chrome and links r broken for me

Profile icon
MatthewXia

@k9chelsea2
ok