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 benefit of abstract class?

995


If a class is declared without any access modifiers, where may the class be accessed in java programming?

1295


Can a constructor call another constructor?

1043


What is java english?

1087


Difference between ‘is-a’ and ‘has-a’ relationship in java?

1045


Which is better singleton or static class?

1028


What is null statement?

1071


What exactly is java?

999


Is it possible to use string in the switch case?

1103


What is the use of coding?

1015


What is functional interface in java?

1095


Is math class static in java?

1157


Why to use nested classes in java?

1190


Explain OOPs concept.

1156


What are the practical benefits, if any, of importing a specific class rather than an entire package (e.g. Import java.net.* Versus import java.net.socket)?

1170