Can we place the any object to key attribute of
HashMap<key,value>?

Answer Posted / ramarao katta

yes, we can place any object as key value but that object
must and should implement the hashcode method.

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between stringbuffer and stringbuilder class?

558


What is the use of math abs in java?

539


How do you reverse sort a list in java?

500


What is the multi-catch block in java?

524


What is the synonym of framework?

554






What are the advantages of assembly language?

493


What is the final keyword?

545


Name few java 8 annotations ?

554


When do I need to use reflection feature in java?

620


Is alive method in java?

500


What is a final class in java?

537


Is a method a function?

538


What is the purpose of format function?

616


what is the role of xml in core java?? and how we can use it?? can somebody give a sample program with explanation and from where i can read more about xml?????

1795


Explain wait(), notify() and notifyall() methods of object class ?

583