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
What is nullpointerexception in java?
What do you mean by ordered and sorted in collections in java?
What is google full form?
Define Multiprogramming and Multiprocessing in java.
What is meant by call by reference?
please send me hr interview questions in it industry
Is the empty set a singleton?
What are format specifiers in java?
How is it possible in java programming for two string objects with identical values not to be equal under the == operator?
Explain about join() method?
What do heavy weight components mean in java programming?
How is the marker interface used in Java?
What are the Main functions of Java?
What is void in java?
What are the methods available in a class?