What is the difference between equals() and "==" ? | Eklavya Online

What is the difference between equals() and “==” ?

Equals is intended to check logical equality and == checks if both references point to same object. (Thanks Sandeep)

a == b;// Compares references, not values.

a.equals(b);// Compares values for equality.