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 |
What is extension method in java?
Give me some null interfaces in java?
What is the inheritance?
What do you know about java?
What is a variable in java?
What are assembly attributes?
Create a form of user Login in JSP, that accepts the user name and password from user and authenticate it with user names and passwords stored in database. (Plz provide me answer immediately)
java program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors.
What is a layout manager?
How many characters is 2 bytes?
What is the difference between class & structure?
What is the difference between Abstract Class and Interface