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
Why does my function print none?
Considering notepad/ie or any other thing as process, what will happen if you start notepad or ie 3 times? Where 3 processes are started or 3 threads are started?
Which sorting is used in arrays sort in java?
What is the list interface in java programming?
How can you handle java exceptions?
What is the full meaning of java?
What is consumer interface?
What is a text string?
Does java arraylist maintain insertion order?
What are locale settings?
Define max and min heap, also the search time of heap.
Why do we declare a class static?
How will you invoke any external process in java?
What is unicode full form?
Explain the difference between comparator and comparable in java?