what is the difference between HashMap and Hashtable

Answer Posted / suresh

HashMap hm=new HashMap();
hm.put("1","11");
hm.put("2","22");
hm.put("3","33");
hm.put("4","242");
hm.put(null,null);
hm.put(null,null);
HashMap also allow more null values

Is This Answer Correct ?    24 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is empty set an element of empty set?

597


What is application tier?

525


What are the difference between string, string builder, and string buffer in java?

551


What is the main use of java?

569


Explain about anonymous inner classes in java?

578






Can a class extend 2 classes in java?

554


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.

1586


What is the escape character in java?

509


What about member inner classes?

623


Differentiate between the constructors and methods in java?

501


What is difference between wait and notify in java?

539


What is json parser in java?

612


Can we use this () and super () in a method?

527


What is args length in java?

660


What is java algorithm?

521