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

Why is core java important?

1009


Can we convert integer to string in java?

1020


How a variable is stored in memory?

938


How to sort elements in a parallel array in java?

848


What is hashing principle in java?

990


What do you understand by overloading and overriding in java?

1031


What are structs in java?

1024


What is heterogeneous in java?

915


What is bytecode in java ?

1140


What is complexity in java?

984


How garbage collection is done in java?

1008


What is the difference between an object-oriented programming language and object-based programming language?

962


Explain about serializable interface in java?

956


Can inner class be public in java?

990


What is unmodifiable collection in java?

880