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 are invisible components?.

0 Answers  


What is the difference between the reader/writer class hierarchy and the inputstream/outputstream class hierarchy in java programming?

0 Answers  


What are Access Specifiers and Access Modifiers.

6 Answers   TCS,


Is arraylist ordered in java?

0 Answers  


What is the life cycle of Servlet?

3 Answers  


What are the different types of java?

0 Answers  


What is meant by interface?

0 Answers  


What is meant by local variable and instance variable?

0 Answers  


What exactly is methodology?

0 Answers  


What is Mutex (Mutual Exclusion Object) ?

0 Answers   Ciena,


What is class variable java?

0 Answers  


Explain in detail about encapsulation with an example?

4 Answers  


Categories