Question: what is the difference between == and equals?
Answer: 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: ... In simple words, == checks if both objects point to the same memory location whereas . equals() evaluates to the comparison of values in the objects.