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 are the disadvantages of using inner classes?

1285


What does system.gc() and runtime.gc() methods do?

1095


What happens if a constructor is declared private?

1075


What mechanism does java use for memory management?

1023


What is the basic of java?

1068


Does java return by reference?

1074


What is complexity in java?

1120


What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?

1176


What is java util concurrentmodificationexception?

961


Can java arraylist hold different types?

1153


What is increment in java?

1013


What does jenkins do?

971


What is difference between public static and void?

1079


What are namespaces in java?

1085


Explain the difference between transient and volatile in java?

1055