Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is the += operator called?

1063


How to avoid memory leak in java?

1139


What is a java string?

1086


When is the finalize() called?

1177


What are thread local variables?

1152


What is a instance variable in java?

1047


Difference between string, stringbuffer and stringbuilder?

1032


If I don't provide any arguments on the command line, then what will the value stored in the string array passed into the main() method, empty or null?

1256


What is static in java?

1098


What is re-factoring in software?

1052


What does 3 dots mean in java?

989


What is the difference between static class and normal class?

1032


What is a marker interface?

1162


Difference between Preemptive scheduling vs. Time slicing?

1021


What is a line separator in java?

981