How to implement Hash Map?

Answer Posted / rice


HashMap is a class that implements Map interface.

HashMap underlined data structure is Hash table.

If we want to describe the group of objects as key ,value
pairs then we go for HashMap class.

key are not duplicated but value can be any thing.

null insertion is possible.

insertion order is not preserved.

HashMap hm=new HashMap();
hm.put(1, "rice");
hm.put(3, "rice");
hm.put(2, "shine");
System.out.println(hm);

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many types of jdk are there?

481


What is injection in java?

470


What if the main method is declared as private?

466


How do I export a java project?

454


What is the use of rs next () in java?

486






How do you find lambda?

482


What is the locale class?

517


What do you mean by exception handling?

476


I have deployed a .war file in my application server comprising of struts and hibernate.If i want to change the "dialect" property of hibernate cfg file how can i change(I have only .war file)... Thanks in advance

1429


What are jpa annotations?

471


What are orm tools in java?

584


What is singleton pattern in java?

441


Do I really have to type in the programs in the book to try them out?

576


What is type_scroll_insensitive in java?

472


What if I write static public void instead of public static void?

466