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 is the difference between lambdas and delegates?

474


What is xml file in java?

481


Which framework is best for rest api java?

471


What is meant by pass by reference and pass by value in java?

512


What do you understand by numeric promotion?

518






Is jprofiler open source?

507


What are the new features about Java se 8 ?

519


Name primitive java types.

517


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

491


What are anonymous methods and lambda expression?

432


What is jsr in java?

486


What is native class in java?

502


Why is lambda expression used?

482


What is predicate in lambda expression?

466


What is ehcache in java?

494