Home
Q&A
Education
Technology
Credit
General
Health
Insurance
Questions
Ask a Question
What is the difference between HashMap and Hashtable in JAVA?
Home
Technology
What is the difference between HashMap and...
asked
May 26, 2021
in
Technology
by
JackTerrance
What is the difference between HashMap and Hashtable in JAVA?
interview-question-answer
technology-questions-answers
1
Answer
0
votes
answered
May 26, 2021
by
JackTerrance
No.
HashMap
Hashtable
1)
HashMap is not synchronized.
Hashtable is synchronized.
2)
HashMap can contain one null key and multiple null values.
Hashtable cannot contain any null key or null value.
3)
HashMap is not ?thread-safe,? so it is useful for non-threaded applications.
Hashtable is thread-safe, and it can be shared between various threads.
4)
4) HashMap inherits the AbstractMap class
Hashtable inherits the Dictionary class.
Related questions
0
votes
Q: What is the difference between HashMap and TreeMap in JAVA?
What is the difference between HashMap and TreeMap in JAVA?...
asked
May 26, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: What is the difference between HashSet and HashMap in JAVA?
What is the difference between HashSet and HashMap in JAVA?...
asked
May 26, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: What is hash-collision in Hashtable and how it is handled in Java?
What is hash-collision in Hashtable and how it is handled in Java?...
asked
May 27, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: What is Hashtable?
What is Hashtable?...
asked
Jul 27, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: Why is Dictionary preferred over Hashtable in C#?
Why is Dictionary preferred over Hashtable in C#?...
asked
Jan 16, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: When using a HashMap are values and keys guaranteed to be in the same order when iterating?
When I iterate over the values or keys are they going to correlate? Will the second key map to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked
Mar 12, 2022
in
Education
by
JackTerrance
javacollections
0
votes
Q: Explain Which of these is the interface of legacy is implemented by Hashtable and Dictionary classes?
Which of these is the interface of legacy is implemented by Hashtable and Dictionary classes? (a) Map (b) ... Framework of Java Select the correct answer from above options...
asked
Mar 1, 2022
in
Education
by
JackTerrance
java
util
0
votes
Q: Which of these is the interface of legacy is implemented by Hashtable and Dictionary classes?
Which of these is the interface of legacy is implemented by Hashtable and Dictionary classes? (a) Map (b ... questions and answers pdf, java interview questions for beginners...
asked
Oct 25, 2021
in
Education
by
JackTerrance
essential-java-interview-questions
java-interview-questions-answers
java-multiple-choice-questions
java-mcq-with-answers
core-java-mcq
core-java-questions
0
votes
Q: What happens if we put a key object in a HashMap which exists?
What happens if we put a key object in a HashMap which exists? (a) The new object replaces the ... programming questions and answers pdf, java interview questions for beginners...
asked
Oct 25, 2021
in
Education
by
JackTerrance
essential-java-interview-questions
java-interview-questions-answers
java-multiple-choice-questions
java-mcq-with-answers
core-java-mcq
core-java-questions
0
votes
Q: Is hashmap an ordered collection.
Is hashmap an ordered collection. (a) True (b) False I had been asked this question during an ... programming questions and answers pdf, java interview questions for beginners...
asked
Oct 25, 2021
in
Education
by
JackTerrance
essential-java-interview-questions
java-interview-questions-answers
java-multiple-choice-questions
java-mcq-with-answers
core-java-mcq
core-java-questions
0
votes
Q: If two threads access the same hashmap at the same time, what would happen?
If two threads access the same hashmap at the same time, what would happen? (a) ConcurrentModificationException ... and answers pdf, java interview questions for beginners...
asked
Oct 25, 2021
in
Education
by
JackTerrance
essential-java-interview-questions
java-interview-questions-answers
java-multiple-choice-questions
java-mcq-with-answers
core-java-mcq
core-java-questions
0
votes
Q: What is a Hashtable in C#?
What is a Hashtable in C#?...
asked
Apr 1, 2021
in
Education
by
JackTerrance
c-sharp-interview-questions
0
votes
Q: What is the difference between the length of an Array and size of ArrayList in Java?
What is the difference between the length of an Array and size of ArrayList in Java?...
asked
May 27, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: What is the difference between Collection and Collections in JAVA?
What is the difference between Collection and Collections in JAVA?...
asked
May 26, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: What is the difference between Set and Map in JAVA?
What is the difference between Set and Map in JAVA?...
asked
May 26, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
...