what is the difference between HashMap and Hashtable
Answer Posted / tarun kumar
class Hashtable was part of the original java.util and is a
concreate implementation of a Dictionary class. In java2 it
is reengineering it so that it also implements the Map
interface.
Thus it is now integrated into the collections framework.
class HashMap implements Map interface.
Because, Hashtable is a concreate implementation of
Dictionary class, is Legacy class, all legacy classes are
synchronized. So,thats why Hashtable is sunchronized.
I can say that both Hashtable and HashMap are same, accept
synchronization.
Is This Answer Correct ? | 22 Yes | 25 No |
Post New Answer View All Answers
Differentiate between nested and inner class in java.
What are the different types of methodologies?
How is Object Oriented Programming different from Procedure Oriented Programming?
How do you square a number?
Is void a type?
What is the set interface in java programming?
What is a priority queue java?
What are the different collection views provided by maps?
What does the “static” keyword mean? Can you override private or static method in java?
Differentiate between a constructor and a method? Can we mark constructors final?
What does it mean that strings are immutable?
What is the default size of load factor in hashing based collection?
What is the difference between multiple processes and multiple threads?
What type of value does sizeof return?
What is merge sort in java?