In general both equals() and “==” operator in Java are used to compare objects to check equality but here are some of the differences between the two: Main difference between .equals() method and == operator is that one is method and other is operator. We can use == operators for reference comparison (address comparison) and …
Continue reading “Difference between == and .equals() method in Java”