Question
Why String is popular HashMap key in Java?

Answers

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 key in a Map and it’s processing is fast than other HashMap key objects. This is why String is mostly used Object as HashMap keys.   Your Comment




More Software,Java Questions..
What is the inputsplit in map reduce software?

Can variables be used in Java without initialization?

What is the difference between java bean and enterprise java bean?

What is software configuration management?

How does the java database connectivity (jdbc) work?

What are the advantages of threads in java?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

What is object cloning in Java?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?



Search
Can you Answer!!
  • Q You have a file employee.txt in the hdfs directory with 100 records. You want to see only the first 10 records from the employee.txt file. How will you do this?
  • Q D D Palmer was the worlds first what
  • Q A female forty years of age presents with episodic vertigo. Vertigo is intense, associated with nausea and vomiting. There is rotation of surroundings. Vertigo lasts for few hours and patient complains of decreased hearing during the attack which improves in between. Patient also complains of tinnitus and fullness of ears . How will you prove the diagnosis?
  • Q what is diffreence between abstract and virtual method in csharp ?
  • Q In the mid-1960's agricultural scientists developed high yielding varieties of ______ ?
  • Q Write a constant time consuming statement lot finding out if a given number is a power of 2?
  • Q The number of schedules in the Constitution of India when it was brought into force:
  • Q The Lok Sabha must meet atleast _____ times in a year.
  • Q What social conditions are most likely to increase criminal behavior?
  • Q How We Can Modify The Css Class In Jquery?
  • Q Mention in what all scenarios entity framework can be applicable?