Can we place the any object to key attribute of
HashMap<key,value>?
Answer Posted / patil abhijeet
Yes we can use object as the key
person p = new person();
HashMap m = new HashMap()
m.put(p,"mysqlf");
above works perfectly fy9 ..... but dont try to use the same
object as key twice :-)
| Is This Answer Correct ? | 5 Yes | 6 No |
Post New Answer View All Answers
What is the use of list in java?
What are the legal parameters?
What is a lambda expression ? What's its use ?
What is the access scope of protected access specifier?
Why java doesn’t support multiple inheritances?
What does @param args mean in java?
What is rule of accessibility in java?
Is node a data type in java?
What is append function?
What is a variable simple definition?
How does linkedlist work in java?
What is java basic concept?
Can you use this() and super() both in a constructor?
If two threads have same priority which thread will be executed first ?
How do you convert bytes to character in java?