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
Answer Posted / 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 View All Answers
Explain the init method?
Explain how to force the garbage collection in java.
List some java keywords sun like c, c + + keywords?
What is the meaning of find and replace?
Which methods cannot be overridden in java?
Can we use both this () and super () in a constructor?
What is the purpose of the runtime class in java programming?
Explain thread in java?
Define the term string pool?
What is the locale class in java programming?
What is the difference between Java and C++?
What is style and indentation?
What are implicit objects in java?
make a method which any number and any type of argument and print sum of that arguments.....
I want my class to be developed in such a way that no other class (even derived class) can create its objects. Define how can I do so?