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 continuity of a function?

1098


Can we override constructor?

1037


How can we access some class in another class in java?

1001


What are passing parameters?

1100


What is a memory leak in java?

1081


What are the rules for variable declaration?

982


How will you compute size of a structure?

1192


What is a “stateless” protocol ?

1000


What is a flag value?

1038


Explain the difference between an Interface and an Abstract class?

1189


What is the arraylist in java?

1064


If I only change the return type, does the method become overloaded?

935


Is nan false?

995


What is finally block?

1070


Can we override the overloaded method?

1155