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 mdb in java?

503


How do you type the lambda symbol?

481


What is web xml java?

506


Which version of jdk is required for netbeans 8.0 2?

431


What about 'hostile applets'? : java security

478






What is cookie in java?

471


What services can invoke lambda?

475


What is stateless and stateful in java?

488


What is the difference between a jdk and a jvm?

485


What is savepoint in java?

457


What is lambda used for?

465


How do I open the java control panel?

494


What is numberformatexception in java?

465


What is dialect in java?

456


Why java?

529