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

What are the benefits of a jar file?

754


What is java lang noclassdeffounderror?

649


Is eclipse a jdk?

659


What is map and flatmap?

778


What is type_scroll_insensitive in java?

668


What about 'hostile applets'? : java security

671


What are the risks in java security? : java security

623


What services can invoke lambda?

629


Is java secure? : java security

733


What is stateless and stateful in java?

667


What is a java executable jar file?

644


What is mq in java?

652


What is @qualifier in java?

679


What about products that claim to block java applets at a firewall? : java security

704


I run a web server. Am I at risk? : java security

658