Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is the use of list in java?

982


What are the legal parameters?

1006


What is a lambda expression ? What's its use ?

1100


What is the access scope of protected access specifier?

992


Why java doesn’t support multiple inheritances?

1034


What does @param args mean in java?

1055


What is rule of accessibility in java?

1024


Is node a data type in java?

997


What is append function?

993


What is a variable simple definition?

1016


How does linkedlist work in java?

919


What is java basic concept?

1034


Can you use this() and super() both in a constructor?

978


If two threads have same priority which thread will be executed first ?

1471


How do you convert bytes to character in java?

996