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 continuity of a function?
Can we override constructor?
How can we access some class in another class in java?
What are passing parameters?
What is a memory leak in java?
What are the rules for variable declaration?
How will you compute size of a structure?
What is a “stateless” protocol ?
What is a flag value?
Explain the difference between an Interface and an Abstract class?
What is the arraylist in java?
If I only change the return type, does the method become overloaded?
Is nan false?
What is finally block?
Can we override the overloaded method?