what is the difference between HashMap and Hashtable
Answer Posted / brijendra kumar soni(xavient)
1-Hashmap is nonSyncronized whereas Hastable is Syncronized.
2-Hashmap allows both key and values are Null whereas
Hastable doesnot allow Null values.
3-Hasmap belongs to Collection package whereas Hashtable is
a class.
4-The class Hashmap implements the map interface whereas
Hastable implements the class.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is a Hash Table? What are the advantages of using a hash table?
What is an inner class in java?
How to retrieve data from database in java using arraylist?
What is the purpose of the enableevents() method in java programming?
In which language java is written?
Draw a UML class diagram for the code fragment given below: public class StringApplet extends Applet { private Label sampleString; private Button showTheString; private ButtonHandler bHandler; private FlowLayout layout; public StringApplet() { sampleString = new Label(" "); showTheString = new Button (" Show the String"); bHandler = new ButtonHandler(); layout = new FlowLayout(); showTheString.addActionListener(bHandler); setLayout(layout); add(sampleString); add(showTheString); } class ButtonHandler implements ActionListener { public void actionPerformed(ActionEvent e) { samplestring.setText("Good Morning"); } } } Note: The methods need not be indicated on the diagram.
What are the ways to instantiate the class class?
Is ruby built on java?
What is garbage collection? What is the process that is responsible for doing that in java?
Which is bigger float or double?
How many types of gc are there in java?
What is the method in java?
What is the difference between final, finally and finalize()?
What do you understand by overloading and overriding in java?
Is namespace same as package in java?