This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
AND if x.equals(y)is false,then x==y may be true???
If equals method is implemented wrongly like using a random number to calculate equality, then it will be false. Under normal circumstances, it will be true.
IS x==y (you forgot one = here) is same as x.hashcode()==y.hashcode()???
Actually equals method is used to check whether two objects are meaningfully equal. Suppose there are two computers on a network with the same name(which is not allowed but let's assume), then they can be called as equals. But they are not == as they are two different machines. If comp1 == comp2 then they are actually the same machine and you are using two different references to point to them. So if == is true (that is you are referring to the same machine) then equals will always be true as the same machine cannot have two names.
You can remember these rules
if == is true, then equals will always be true if equals is true, then hashCode will always be same