b) creating hash out of the member variables of object and then comparing that hash.

I think equals method should be faster but my friend argues if we create a string of member variables values and generate its hash and compare it it will be faster as it will do one comparison instead of n comparison which it does in equal method. n being the number of variables.

So you have to use equals to compare to object. In case of the string, if hashcode is cashed, you can first compare them. In this case, if hashcodes are not equal, you can be 100% sure the string are not equal to.