How to implement Hash Map?

Answer Posted / brijendra-java (xavient)

HashMap is the implementaion of Map interface.
HashMap is key value pair storage concept.
HasMap does not allow duplicate key but value may be any
thing.
HasMap allow both key and Valuea as NULL.
HasMap is the Unordered collection.
When we change the iteration of HasMap then it give
concurrent Modification error.
HasMap is NonSyncronised class.

HashMap hMap = new HashMap();
hMap.put(Null, Null);
hMap.put(1, a);
hMap.put(2, b);
hMap.put(3, c);
system.out.println("Size"+hMap.size());

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If you’re overriding the method equals() of an object, which other method you might also consider?

593


How do I know if I have jre or jdk?

579


How do I open my java console?

566


How do I run a project in netbeans?

548


Is jdk an ide?

580






What happens when the parent process of a child process exits before the child ?

612


In which language eclipse is developed?

546


Why are lambda functions called lambda?

556


Why do we need new date and time api in java se 8?

556


What are the advantages of java sockets?

758


What are the advantages of java 8’s date and time api over old date api and joda time api?

722


explain how java se 8 data and time api solves issues of old java date api?

630


What is jep in java?

552


What is resultsetmetadata in java?

577


Is java built on c?

579