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

What is type casting?

2 Answers  


Why Over riding is Run Time Polymorphism?

3 Answers   Genpact,


what are the analysis of an object

2 Answers  


What is the difference between method overriding and overloading?

0 Answers  


What is a singleton factory?

0 Answers  


How many java versions are there?

0 Answers  


Why only one Class is public in one file? Explain in details. Thanks in Advance.

12 Answers  


What is a “stateless” protocol ?

0 Answers  


What is the purpose of static methods and static variables?

0 Answers  


What is the use of beaninfo?

0 Answers  


Is hashmap thread safe?

0 Answers  


What is the arraylist in java?

0 Answers  


Categories