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. In Core Java, the difference between equals() and == lies in their functionality and what they compare: equals() method: equals() is a method defined … Read more