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 a jagged array in java?

0 Answers  


What is the purpose of lambda expressions?

0 Answers  


How many bits is a string in java?

0 Answers  


What is thread safe singleton?

0 Answers  


Advantages of Inheritance in java.

11 Answers   CybAge, HCL,






What error occurs if a try-catch-finally statement sequence does not have a catch clause?

4 Answers  


Does java arraylist maintain insertion order?

0 Answers  


What is the need to implement Serializable interface (with no methods) for objects which are to be serialized ? We can write our own functionality which writes objects to streams then why we need to implement and tell JVM that which objects can be serialized.

6 Answers   iFlex, Sapient,


How does synchronized modifier work?

1 Answers   IBM,


Can we have more than one package statement in source file ?

0 Answers  


Can you tell me range of byte?

0 Answers  


What are the supported platforms by java programming language?

0 Answers  


Categories