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

Explain access specifiers?

1 Answers   Thomson Reuters, Virtusa,


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

1 Answers  


what is the logic inside any default constuctor?

2 Answers  


whats the life cycle of jsp

2 Answers   Satyam,


What is the difference between the paint() and repaint() methods?

1 Answers  


Can you declare the main method as final?

1 Answers  


How does thread synchronization occurs inside a monitor? What levels of synchronization can you apply?

1 Answers  


What is the meaning of variable in research?

1 Answers  


What is the difference between the paint() and repaint() methods in java programming?

1 Answers  


What is the benefit of lambda expressions?

1 Answers  


What are the uses of synchronized keyword?

1 Answers  


Which software is used for java programming?

1 Answers  


Categories