Question: Whats the difference between containsValue and contains method of Hashtable
<http://docs.oracle.com/javase/7/docs/api/java/util/Hashtable.html>

Answer: 
There isn't one. Emphasis mine.

> 
> Returns true if this hashtable maps one or more keys to this value.
>  Note that **this method is identical in functionality to `contains` (which predates the Map interface).**
> 
> 
> 

So you can use either one, I would perfer `containsValue()` because it is a bit more self-explanatory, but that's just me.

The reason that there are two different methods for the same thing is because `HashTable` `implements` the `Map<K, V>` interface. I don't know if you've used interfaces yet, but all classes that `implement` an interface are required to have all the methods defined in that `interface`. So, because `Map` has a definition for `boolean containsValue(Object value);` any classes that `implement` it (like `HashTable`) also has to have that method. So that's why `containsValue()` exists.

Then why do we have to also have `contains()`? Well, that's because `contains()` existed even before the `Map` interface existed (see the documentation snippet above). `contains()` came first, that's why it has all of the functionality. When the `Map` interface was added the class had to add the `containsValue()` method, and they didn't want to duplicate the code that was already in the `contains` method, so they just called it.
If you read the full documentation for `contains()`, you will see

> 
> Note that this method is identical in functionality to containsValue, (which is part of the Map interface in the collections framework).
> 
> 
>