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

Answer Posted / patil abhijeet

Hi Ramarao,
Its not necessary to override hashCode() since hashcode is
default generated for every object. Please try my example n
check it by urself

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the pillars of java?

482


What is stringjoiner ?

569


How to create a thread in java?

594


What is difference between word and integer?

586


Why is static used?

537






Which method cannot be overridden in java?

581


What is the difference between synchronized and synchronized block?

495


How does arrays sort work in java?

589


Difference difference paint() and paintcomponent()?

523


What is data member in java?

492


Can a class be a super class and a sub-class at the same time? Give example.

786


What is empty string literal in java?

553


What is thread pool in java with example?

534


What are 3 data types?

536


Is {a, n, d} a palindrome? If you are given a random string, is it a palindrome or not?

615