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 abstract class has default constructor?

2 Answers  


Can one thread block the other thread?

0 Answers  


how do I create a runnable with inheritance? : Java thread

0 Answers  


What is the latest java version?

0 Answers  


Why is java so popular?

0 Answers  


Difference between notify() method and notifyall() method in java?

0 Answers  


What is scope of a variable?

0 Answers   TCS,


How is object created in java?

5 Answers   Cap Gemini,


Which containers may have a MenuBar?

1 Answers  


What's the difference between int and integer in java?

0 Answers  


What is a stack class in java ?

0 Answers   Akamai Technologies,


What are the changes in java.io in java 8 ?

0 Answers  


Categories