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

How does arraylist work in java?

0 Answers  


What is empty string literal in java?

0 Answers  


How to create an instance of a class if the class has private constructor?

3 Answers  


what do you meant by Runtime Polymorphism?

13 Answers   BVIMR, IBM, Persistent,


What is the purpose of final keyword and when to use it?

0 Answers  


What are assertions in java?

1 Answers   Impetus,


What is native code?

0 Answers  


What is core java called?

0 Answers  


What is local class in java?

0 Answers  


What is final keyword?

0 Answers  


How does arraylist size increase in java?

0 Answers  


How many types of gc are there in java?

0 Answers  


Categories