FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
java-programming/javaUpdates/src/map/MapDemo.java at master · 9146887137/java-programming · GitHub
9146887137
/
java-programming
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
java-programming
/
javaUpdates
/
src
/
map
/
MapDemo.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
27 lines (20 loc) · 680 Bytes
Breadcrumbs
java-programming
/
javaUpdates
/
src
/
map
/
MapDemo.java
Copy path
File metadata and controls
27 lines (20 loc) · 680 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package
map
;
import
java
.
util
.
HashMap
;
import
java
.
util
.
concurrent
.
ConcurrentHashMap
;
public
class
MapDemo
{
public
static
void
main
(
String
[]
args
) {
ConcurrentHashMap
<
Integer
,
String
>
cm
=
new
ConcurrentHashMap
<
Integer
,
String
>();
cm
.
put
(
1
,
"akash"
);
cm
.
put
(
2
,
"ramesh"
);
cm
.
put
(
3
,
"abhi"
);
cm
.
put
(
4
,
"sumit"
);
System
.
out
.
println
(
cm
);
System
.
out
.
println
(
ConcurrentHashMap
.
newKeySet
());
HashMap
<
Integer
,
String
>
sm
=
new
HashMap
<
Integer
,
String
>(
cm
);
sm
.
put
(
null
,
null
);
sm
.
put
(
null
,
null
);
sm
.
put
(
7
,
null
);
System
.
out
.
println
(
sm
.
computeIfAbsent
(
9
, (
a
)->
sm
.
get
(
a
).
concat
(
"Akash"
)));
System
.
out
.
println
(
sm
.
keySet
());
}
}
Back
|
FazBrowse Home
|
New Git URL