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?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain about doubly linked list

1093


What is a final class in java?

1064


What is the default value of an object reference declared as an instance variable?

1172


What is included in core java?

1098


What are 4 pillers of object orinted programming?

1074


How to create a fecelet view?

1044


What loop means?

1003


What is the purpose of the file class in java programming?

1095


Is java a virus?

1021


Can a class be declared as protected?

1058


Why unicode is important?

978


What happens to a static var that is defined within a method of a class?

1084


What are the benefits of immutable objects?

1055


Why are generics used?

1033


Can we change the scope of the overridden method in the subclass?

1457