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...

Why string is popular hashmap key in java?

Answer Posted / vishalshetkar

Since String is immutable, its hashcode is cached at the time of creation and it doesn’t need to be calculated again. This makes it a great candidate for keys in a Map and its processing is fast than other HashMap key objects. This is why String is mostly used Object as HashMap keys.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why does my function print none?

951


Considering notepad/ie or any other thing as process, what will happen if you start notepad or ie 3 times? Where 3 processes are started or 3 threads are started?

1156


Which sorting is used in arrays sort in java?

1080


What is the list interface in java programming?

1117


How can you handle java exceptions?

1029


What is the full meaning of java?

1042


What is consumer interface?

997


What is a text string?

1081


Does java arraylist maintain insertion order?

991


What are locale settings?

990


Define max and min heap, also the search time of heap.

1027


Why do we declare a class static?

1151


How will you invoke any external process in java?

1116


What is unicode full form?

981


Explain the difference between comparator and comparable in java?

944