Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
What is the requirement for an object to be used as key or value in HashMap?
Home
DBMS
What is the requirement for an object to be used as key or value in HashMap?
0
votes
asked
Aug 10, 2023
in
DBMS
by
DavidAnderson
What is the requirement for an object to be used as key or value in HashMap?
dbms
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Aug 10, 2023
by
DavidAnderson
The key or value object that gets used in the hashmap must implement
equals()
and
hashcode()
method.
The hash code is used when inserting the key object into the map and the equals method is used when trying to retrieve a value from the map.
Related questions
0
votes
Q: What is the time complexity of basic operations get() and put() in HashMap class?
asked
Aug 10, 2023
in
DBMS
by
DavidAnderson
dbms
0
votes
Q: How does HashMap handle collisions in Java?
asked
Aug 10, 2023
in
DBMS
by
DavidAnderson
dbms
0
votes
Q: What are some key operations performed on the Deque data structure?
asked
Aug 10, 2023
in
DBMS
by
DavidAnderson
dbms
+1
vote
Q: The following language used by most of the DBMSs for helping their users to access data
asked
Dec 4, 2022
in
DBMS
by
SakshiSharma
dbms
+1
vote
Q: This set of related data items is known as a
asked
Dec 4, 2022
in
DBMS
by
SakshiSharma
record-data
dbms
+1
vote
Q: Which command is used to replace ?
asked
Dec 4, 2022
in
DBMS
by
SakshiSharma
dbms
replace
+1
vote
Q: The following command is used to search the record that satisfies the specified criteria
asked
Dec 4, 2022
in
DBMS
by
SakshiSharma
dbms
0
votes
Q: What is graph data structure and its representations? What are the applications for graphs?
asked
Aug 10, 2023
in
DBMS
by
DavidAnderson
dbms
0
votes
Q: What is a priority queue? What are the applications for priority queue?
asked
Aug 10, 2023
in
DBMS
by
DavidAnderson
dbms
0
votes
Q: What is a deque data structure and its types? What are the applications for deque?
asked
Aug 10, 2023
in
DBMS
by
DavidAnderson
dbms
...