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

What is string in java?

960


What are the main uses of the super keyword?

921


What is an example of procedure?

954


What package is math in java?

946


How many types of classes are there in java?

996


What are methods?

963


What is null mean in java?

1028


How many JVMs can run on a single machine and what is the Just-In-Time(JIT) compiler?

998


Is set ordered in java?

942


What is the difference between notify and notifyall method?

1105


What are the major advantages of internal iteration over external iteration?

986


Explain about method local inner classes or local inner classes in java?

963


Can we return null in java?

1065


What is operator overloading. Is it is supported in java?

947


Why java is called not pure object oriented language?

967