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?



Why string is popular hashmap key in java?..

Answer / 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

More Core Java Interview Questions

why the equals method can be override?when we override the equals method?

5 Answers  


What is runtime polymorphism or dynamic method dispatch?

0 Answers  


which of tha following is not a thread safe class? a) ArrayList b)Vector c)HashTable d)None

17 Answers  


What is module with example?

0 Answers  


What is java in layman terms?

0 Answers  


What is java command?

0 Answers  


What are the differences between this and super keyword?

0 Answers  


What is difference between core java and java ee?

0 Answers  


Do you need to import math in java?

0 Answers  


How can an object be unreferenced?

0 Answers  


Write a java program to generate fibonacci series ?

0 Answers   Cyient,


How do I write a self declaration?

0 Answers  


Categories