Hi Friends, Can u give few interview questions which relates
ArrayList and Hashmap. I mean how to link ArrayList and
HashMap.I know this is not good way of asking questions like
this , but i need



Hi Friends, Can u give few interview questions which relates ArrayList and Hashmap. I mean how to l..

Answer / murali,25@gmail.com

HashMap stores key-value pairs. Alternate approach is to have a plain java class with key,value as attributes.
class HashMapAlternate{
Object key;
Object value;
}

You can create objects of HashMapAlternate and store it in arraylist. But HashMap is a better solution because it uses hashing and collision resolution technique which speeds up lookup when number of objects are very large.

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More Core Java Interview Questions

what is the use of pojo (plain old java objects)? how it is interact with crystal reports? pls urgent

0 Answers  


Why can't we make a class private in java?

0 Answers  


What is a function argument in java?

0 Answers  


What is the protocol is used in type4 driver?

4 Answers   CMC,


What is difference between hashset and hashmap?

0 Answers  






What happens if an exception is throws from an object's destructor?

0 Answers   Amazon,


Is Constructor possible in abstract class in java ?

0 Answers   HCL,


Can we force garbage collector to run ?

0 Answers   B-Ways TecnoSoft,


What is sortedset in java?

0 Answers  


What are concepts of OOPS and how are they implemented in Java?

2 Answers   KPIT,


what is the difference between statis block and static variable

7 Answers  


What is api in java?

0 Answers  


Categories