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

write a program that list all permutations of ABCDEF in which A appears before B?

2436


What do you understand by the term polymorphism?

999


What is the difference between the paint() and repaint() methods in java programming?

1131


Can we override constructors in java?

1070


Difference between string s= new string (); and string s = "abv";?

1157


What is bytecode in java ?

1116


What is the syntax and characteristics of a lambda expression? Explain

992


What is the purpose of final keyword and when to use it?

940


What is jvm? How its run?

1018


what is a green thread? : Java thread

952


What is the base class of all exception classes in java?

998


What is array and arraylist in java?

1043


Is cout buffered?

1111


Explain a situation where finally block will not be executed?

970


What best practices should you follow while writing multithreaded code in java?

994