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 / 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 |
Why do I need to declare the type of a variable in java?
Can we override a variable in java?
Can we declare an array without size in java?
What is string builder in java?
Does java have extension methods?
What is the default value of float and double datatype in java?
What is the difference between math floor and math round?
Where can i get Latest SUN Certification Dumps and what are the Sun Certification Codes that are available, Im new to JAVA, so please gimme info as i need to write J2EE - Core Java Certification
Why we need Finally with try? pls expain with ur example..
Is passing by reference faster?
What is nan in java?
what is webservices?