Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How can I camper between 2 hashtables?  RSS feed

 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there is afast way to compeer 2 hashtables if they contains the same key/values pairs?
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can just use equals() to compare the Hashtables, that should do exactly what you want, according to the API documentation.

Ofcourse you need to make sure that the classes that you use for the keys and values properly implement equals() and hashCode(), so that Java can compare them.
[ August 26, 2007: Message edited by: Jesper Young ]
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!